1 #include <c10/macros/Macros.h> 2 #include <torch/csrc/utils/object_ptr.h> 3 4 #include <torch/csrc/python_headers.h> 5 6 template <> free()7void THPPointer<PyObject>::free() { 8 if (ptr && C10_LIKELY(Py_IsInitialized())) 9 Py_DECREF(ptr); 10 } 11 12 template class THPPointer<PyObject>; 13 14 template <> free()15void THPPointer<PyCodeObject>::free() { 16 if (ptr && C10_LIKELY(Py_IsInitialized())) 17 Py_DECREF(ptr); 18 } 19 20 template class THPPointer<PyCodeObject>; 21 22 template <> free()23void THPPointer<PyFrameObject>::free() { 24 if (ptr && C10_LIKELY(Py_IsInitialized())) 25 Py_DECREF(ptr); 26 } 27 28 template class THPPointer<PyFrameObject>; 29