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 | |
SavedVariable & | operator= (SavedVariable &&)=default |
Variable | unpack (std::shared_ptr< Function > saved_for=nullptr) const |
Reconstructs the saved variable. More... | |
void | reset_data () |
void | reset_grad_function () |
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.
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.