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