mirror of
https://github.com/saymrwulf/pytorch.git
synced 2026-05-15 21:00:47 +00:00
Fixes #144302 Try to expose several APIs to public for privateuse1 scenario. Pull Request resolved: https://github.com/pytorch/pytorch/pull/144525 Approved by: https://github.com/cyyever, https://github.com/albanD
28 lines
643 B
C++
28 lines
643 B
C++
#include <c10/macros/Macros.h>
|
|
#include <torch/csrc/utils/object_ptr.h>
|
|
|
|
#include <torch/csrc/python_headers.h>
|
|
|
|
template <>
|
|
TORCH_PYTHON_API void THPPointer<PyObject>::free() {
|
|
if (ptr && C10_LIKELY(Py_IsInitialized()))
|
|
Py_DECREF(ptr);
|
|
}
|
|
|
|
template class THPPointer<PyObject>;
|
|
|
|
template <>
|
|
TORCH_PYTHON_API void THPPointer<PyCodeObject>::free() {
|
|
if (ptr && C10_LIKELY(Py_IsInitialized()))
|
|
Py_DECREF(ptr);
|
|
}
|
|
|
|
template class THPPointer<PyCodeObject>;
|
|
|
|
template <>
|
|
TORCH_PYTHON_API void THPPointer<PyFrameObject>::free() {
|
|
if (ptr && C10_LIKELY(Py_IsInitialized()))
|
|
Py_DECREF(ptr);
|
|
}
|
|
|
|
template class THPPointer<PyFrameObject>;
|