Template Function torch::load(std::vector<torch::Tensor>&, LoadFromArgs&&…)¶
Defined in File serialize.h
Function Documentation¶
-
template<typename ...LoadFromArgs>
void torch::load(std::vector<torch::Tensor> &tensor_vec, LoadFromArgs&&... args)¶ Deserializes the given
tensor_vec
of typestd::vector<torch::Tensor>
.To perform the serialization, a
serialize::InputArchive
is constructed, and all arguments after thevalue
are forwarded to itsload_from
method. For example, you can pass a filename, or anistream
.std::vector<torch::Tensor> tensor_vec; torch::load(tensor_vec, "my_tensor_vec.pt"); std::vector<torch::Tensor> tensor_vec; std::istringstream stream("..."); torch::load(tensor_vec, stream);