pytorch/torch/csrc/utils/object_ptr.cpp
albanD 4b7de26556 Fix C API to be compatible with latest 3.11 beta (#81242)
Based off https://github.com/pytorch/pytorch/pull/80511 with extra changes:
- Update pybind to the latest release as it contains some needed fixes
- Extend the compat header to do reduce changes in code
Pull Request resolved: https://github.com/pytorch/pytorch/pull/81242
Approved by: https://github.com/malfet, https://github.com/mattip
2022-07-27 08:37:10 +00:00

28 lines
459 B
C++

#include <torch/csrc/utils/object_ptr.h>
#include <torch/csrc/python_headers.h>
template <>
void THPPointer<PyObject>::free() {
if (ptr)
Py_DECREF(ptr);
}
template class THPPointer<PyObject>;
template <>
void THPPointer<PyCodeObject>::free() {
if (ptr)
Py_DECREF(ptr);
}
template class THPPointer<PyCodeObject>;
template <>
void THPPointer<PyFrameObject>::free() {
if (ptr)
Py_DECREF(ptr);
}
template class THPPointer<PyFrameObject>;