Caffe2 - C++ API
A deep learning, cross platform ML framework
Public Member Functions
torch::serialize::OutputArchive Class Referencefinal

Public Member Functions

 OutputArchive ()
 Default-constructs the OutputArchive.
 
 OutputArchive (OutputArchive &&)=default
 
OutputArchiveoperator= (OutputArchive &&)=default
 
 OutputArchive (OutputArchive &)=delete
 
OutputArchiveoperator= (OutputArchive &)=delete
 
void write (const std::string &key, const Tensor &tensor, bool is_buffer=false)
 Writes a (key, tensor) pair to the OutputArchive, and marks it as being or not being a buffer (non-differentiable tensor). More...
 
void write (const std::string &key, OutputArchive &nested_archive)
 Writes a nested OutputArchive under the given key to this OutputArchive. More...
 
void save_to (const std::string &filename)
 Saves the OutputArchive into a serialized representation in a file at filename. More...
 
void save_to (std::ostream &stream)
 Saves the OutputArchive into a serialized representation into the given stream. More...
 
template<typename... Ts>
void operator() (Ts &&...ts)
 Forwards all arguments to write(). More...
 

Detailed Description

Definition at line 25 of file output-archive.h.

Member Function Documentation

template<typename... Ts>
void torch::serialize::OutputArchive::operator() ( Ts &&...  ts)
inline

Forwards all arguments to write().

Useful for generic code that can be re-used for both OutputArchive and InputArchive (where operator() forwards to read()).

Definition at line 61 of file output-archive.h.

void torch::serialize::OutputArchive::save_to ( const std::string &  filename)

Saves the OutputArchive into a serialized representation in a file at filename.

Definition at line 33 of file output-archive.cpp.

void torch::serialize::OutputArchive::save_to ( std::ostream &  stream)

Saves the OutputArchive into a serialized representation into the given stream.

Definition at line 38 of file output-archive.cpp.

void torch::serialize::OutputArchive::write ( const std::string &  key,
const Tensor tensor,
bool  is_buffer = false 
)

Writes a (key, tensor) pair to the OutputArchive, and marks it as being or not being a buffer (non-differentiable tensor).

Definition at line 20 of file output-archive.cpp.

void torch::serialize::OutputArchive::write ( const std::string &  key,
OutputArchive nested_archive 
)

Writes a nested OutputArchive under the given key to this OutputArchive.

Definition at line 27 of file output-archive.cpp.


The documentation for this class was generated from the following files: