From a698eb7d28bd1e426dd7ab359d88fa52747d0cac Mon Sep 17 00:00:00 2001 From: HongyuJia Date: Fri, 17 Mar 2023 10:17:16 +0800 Subject: [PATCH] [Polish utils/pybind.h] Delete p_tensor_type in pybind.h (#51715) --- paddle/utils/pybind.cc | 4 ++-- paddle/utils/pybind.h | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/paddle/utils/pybind.cc b/paddle/utils/pybind.cc index 24b1c4f65c3..7e93dcff140 100644 --- a/paddle/utils/pybind.cc +++ b/paddle/utils/pybind.cc @@ -21,8 +21,8 @@ DECLARE_string(tensor_operants_mode); namespace paddle { namespace pybind { -PyTypeObject* p_tensor_type; -PyTypeObject* p_string_tensor_type; +PyTypeObject* p_tensor_type = nullptr; +PyTypeObject* p_string_tensor_type = nullptr; bool PyCheckTensor(PyObject* obj) { if (!p_tensor_type) { diff --git a/paddle/utils/pybind.h b/paddle/utils/pybind.h index 4c4ef296a4e..c065a8de223 100644 --- a/paddle/utils/pybind.h +++ b/paddle/utils/pybind.h @@ -24,8 +24,6 @@ namespace py = pybind11; namespace paddle { namespace pybind { -extern PyTypeObject* p_tensor_type; - typedef struct { PyObject_HEAD paddle::Tensor tensor; // Weak references -- GitLab