mirror of
https://github.com/pytorch/pytorch.git
synced 2025-11-11 22:34:53 +08:00
This removes volatile from Variable. The functionality is mostly replaced by a global (thread-local) flag, which is controlled by torch.set_grad_enabled() and the context manager torch.no_grad(). In C++, the flag is exposed through GradMode::is_enabled() and GradMode::set_enabled() Fixes #3627
20 lines
439 B
C++
20 lines
439 B
C++
#ifndef THP_AUTOGRAD_H
|
|
#define THP_AUTOGRAD_H
|
|
|
|
PyObject * THPAutograd_initExtension(PyObject *_unused);
|
|
bool THPAutograd_initFunctions(PyObject* module);
|
|
|
|
namespace torch { namespace autograd {
|
|
|
|
void initAutogradClosureBindings(PyObject* module);
|
|
|
|
PyMethodDef* python_functions();
|
|
|
|
}}
|
|
|
|
#include "torch/csrc/autograd/python_function.h"
|
|
#include "torch/csrc/autograd/python_variable.h"
|
|
#include "torch/csrc/autograd/python_engine.h"
|
|
|
|
#endif
|