/usr/local/lib64/python3.6/site-packages/torch/include/torch/csrc/autograd
NameSizeModeActions
functions/-0755rm
generated/-0755rm
utils/-0755rm
anomaly_mode.h15250644editdlrm
autograd.h52940644editdlrm
autograd_not_implemented_fallback.h2010644editdlrm
cpp_hook.h5180644editdlrm
custom_function.h144700644editdlrm
edge.h16270644editdlrm
engine.h172370644editdlrm
forward_grad.h85830644editdlrm
function.h250460644editdlrm
FunctionsManual.h199040644editdlrm
function_hook.h6410644editdlrm
grad_mode.h2070644editdlrm
InferenceMode.h1820644editdlrm
input_buffer.h15970644editdlrm
input_metadata.h13840644editdlrm
profiler.h1120644editdlrm
profiler_kineto.h91110644editdlrm
profiler_legacy.h169300644editdlrm
profiler_utils.h4390644editdlrm
python_anomaly_mode.h12460644editdlrm
python_autograd.h3880644editdlrm
python_cpp_function.h24560644editdlrm
python_engine.h12620644editdlrm
python_fft_functions.h1280644editdlrm
python_function.h40990644editdlrm
python_hook.h7000644editdlrm
python_legacy_variable.h2990644editdlrm
python_linalg_functions.h1310644editdlrm
python_mode.h4250644editdlrm
python_nn_functions.h1270644editdlrm
python_saved_variable_hooks.h8830644editdlrm
python_special_functions.h1320644editdlrm
python_torch_functions.h6710644editdlrm
python_variable.h16450644editdlrm
python_variable_indexing.h3130644editdlrm
record_function_ops.h5870644editdlrm
saved_variable.h43220644editdlrm
saved_variable_hooks.h2720644editdlrm
symbolic.h3300644editdlrm
variable.h334110644editdlrm
VariableTypeUtils.h150860644editdlrm
Edit: /usr/local/lib64/python3.6/site-packages/torch/include/torch/csrc/autograd/python_cpp_function.h (2456B)
#pragma once #include #include #include #include #include #include namespace torch { namespace autograd { struct THPCppFunction { PyObject_HEAD std::shared_ptr cdata; }; template PyObject* CppFunction_pynew(PyTypeObject *type, PyObject *args, PyObject *kwds) { THPObjectPtr obj(type->tp_alloc(type, 0)); if (!obj) return nullptr; THPCppFunction* f = (THPCppFunction*)obj.get(); HANDLE_TH_ERRORS new (&f->cdata) std::shared_ptr(Ctor()(args)); END_HANDLE_TH_ERRORS if (!f->cdata) { return nullptr; } return obj.release(); } #define THP_FUNCTION_DEFAULT_METHODS \ {(char*)"_register_hook_dict", THPCppFunction_register_hook_dict, METH_O, nullptr}, \ {(char*)"register_hook", THPCppFunction_register_hook, METH_O, nullptr}, \ {(char*)"name", THPCppFunction_name, METH_NOARGS, nullptr} #define THP_FUNCTION_DEFAULT_PROPERTIES \ {(char*)"next_functions", (getter)THPCppFunction_next_functions, nullptr, nullptr, nullptr}, \ {(char*)"requires_grad", (getter)THPCppFunction_requires_grad, nullptr, nullptr, nullptr}, \ {(char*)"metadata", (getter)THPCppFunction_metadata, nullptr, nullptr, nullptr} PyObject* THPCppFunction_next_functions(THPCppFunction* self, PyObject* hook); PyObject* THPCppFunction_metadata(THPCppFunction *self, void *_unused); PyObject* THPCppFunction_requires_grad(THPCppFunction* self, void *_unused); PyObject* THPCppFunction_register_hook_dict(PyObject* self, PyObject* _var); PyObject* THPCppFunction_register_hook(PyObject* self, PyObject* hook); PyObject* THPCppFunction_name(PyObject* self, PyObject *noargs); PyTypeObject* _initFunctionPyTypeObject(PyTypeObject& type, const char* name, PyGetSetDef* function_properties, PyMethodDef* function_methods); PyObject* registerFunctionHook(Node& fn, PyObject* hook); template PyTypeObject* createForwardFunctionPyTypeObject(PyTypeObject& type, const char* name, PyGetSetDef* function_properties=nullptr, PyMethodDef* function_methods=nullptr) { type.tp_new = &CppFunction_pynew; return _initFunctionPyTypeObject(type, name, function_properties, function_methods); } void registerCppFunction(const std::type_info& type, PyTypeObject* pytype); PyObject* functionToPyObject(const std::shared_ptr& cdata); }} // namespace torch::autograd