Caffe2 - C++ API
A deep learning, cross platform ML framework
Public Member Functions
torch::autograd::SavedVariable Class Reference

A snapshot of a variable at a certain version. More...

#include <saved_variable.h>

Public Member Functions

 SavedVariable (const Variable &variable, bool is_output)
 
 SavedVariable (SavedVariable &&)=default
 
SavedVariableoperator= (SavedVariable &&)=default
 
Variable unpack (std::shared_ptr< Function > saved_for=nullptr) const
 Reconstructs the saved variable. More...
 
void reset_data ()
 
void reset_grad_function ()
 

Detailed Description

A snapshot of a variable at a certain version.

A SavedVariable stores enough information to reconstruct a variable from a certain point in time.

Definition at line 21 of file saved_variable.h.

Member Function Documentation

Variable torch::autograd::SavedVariable::unpack ( std::shared_ptr< Function >  saved_for = nullptr) const

Reconstructs the saved variable.

Pass saved_for as the gradient function if constructing the SavedVariable with it would have caused a circular reference.

Definition at line 34 of file saved_variable.cpp.


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