mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
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
28 lines
459 B
C++
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>;
|