3 #include <torch/csrc/python_headers.h> 7 #include <torch/csrc/autograd/variable.h> 8 #include <torch/csrc/THP_export.h> 18 PyObject* backward_hooks =
nullptr;
21 THP_API PyObject *THPVariableClass;
23 bool THPVariable_initModule(PyObject *module);
26 inline bool THPVariable_Check(PyObject *obj)
28 return THPVariableClass && PyObject_IsInstance(obj, THPVariableClass);
36 inline at::Tensor& THPVariable_UnpackData(PyObject* obj) {
38 return var->cdata.data();
Variable A Variable augments a Tensor with the ability to interact in our autograd machinery...