3 #include <torch/serialize/archive.h> 4 #include <torch/serialize/tensor.h> 36 template <
typename Value,
typename... SaveToArgs>
37 void save(
const Value& value, SaveToArgs&&... args) {
38 serialize::OutputArchive archive;
40 archive.save_to(std::forward<SaveToArgs>(args)...);
69 template <
typename Value,
typename... LoadFromArgs>
70 void load(Value& value, LoadFromArgs&&... args) {
71 serialize::InputArchive archive;
72 archive.load_from(std::forward<LoadFromArgs>(args)...);