Class OutputArchive#
Defined in File output-archive.h
Page Contents
Class Documentation#
-
class OutputArchive#
Public Functions
-
inline explicit OutputArchive()#
-
OutputArchive(OutputArchive&&) = default#
-
OutputArchive &operator=(OutputArchive&&) = default#
-
OutputArchive(OutputArchive&) = delete#
-
OutputArchive &operator=(OutputArchive&) = delete#
-
inline std::shared_ptr<jit::CompilationUnit> compilation_unit() const#
-
void write(const std::string &key, const c10::IValue &ivalue)#
Writes an
IValueto theOutputArchive.
-
void write(const std::string &key, const Tensor &tensor, bool is_buffer = false)#
Writes a
(key, tensor)pair to theOutputArchive, and marks it as being or not being a buffer (non-differentiable tensor).
-
void write(const std::string &key, OutputArchive &nested_archive)#
Writes a nested
OutputArchiveunder the givenkeyto thisOutputArchive.
-
void save_to(const std::string &filename)#
Saves the
OutputArchiveinto a serialized representation in a file atfilename.
-
void save_to(std::ostream &stream)#
Saves the
OutputArchiveinto a serialized representation into the givenstream.
-
void save_to(const std::function<size_t(const void*, size_t)> &func)#
Saves the
OutputArchiveinto a serialized representation using the given writer function.
-
template<typename ...Ts>
inline void operator()(Ts&&... ts)# Forwards all arguments to
write().Useful for generic code that can be reused for both
OutputArchiveandInputArchive(whereoperator()forwards toread()).
-
inline explicit OutputArchive()#