Template Function torch::load(std::vector<torch::Tensor>&, LoadFromArgs&&…)

Function Documentation

template<typename ...LoadFromArgs>
void torch::load(std::vector<torch::Tensor> &tensor_vec, LoadFromArgs&&... args)

Deserializes the given tensor_vec of type std::vector<torch::Tensor>.

To perform the serialization, a serialize::InputArchive is constructed, and all arguments after the value are forwarded to its load_from method. For example, you can pass a filename, or an istream.

std::vector<torch::Tensor> tensor_vec;
torch::load(tensor_vec, "");

std::vector<torch::Tensor> tensor_vec;
std::istringstream stream("...");
torch::load(tensor_vec, stream);


Access comprehensive developer documentation for PyTorch

View Docs


Get in-depth tutorials for beginners and advanced developers

View Tutorials


Find development resources and get your questions answered

View Resources