diff --git a/paddle/utils/pybind.cc b/paddle/utils/pybind.cc index c63b16b3d0ccc8618550e08deed9b1b4f621c2b5..c67acffff0c2c6ab71f7bd94d12765ca96f2453e 100644 --- a/paddle/utils/pybind.cc +++ b/paddle/utils/pybind.cc @@ -31,7 +31,8 @@ bool PyCheckTensor(PyObject* obj) { return PyObject_IsInstance(obj, reinterpret_cast(p_tensor_type)); } -paddle::experimental::Tensor CastPyArg2Tensor(PyObject* obj, ssize_t arg_pos) { +paddle::experimental::Tensor CastPyArg2Tensor(PyObject* obj, + Py_ssize_t arg_pos) { if (PyObject_IsInstance(obj, reinterpret_cast(p_tensor_type)) || PyObject_IsInstance(obj, reinterpret_cast(p_string_tensor_type))) { diff --git a/paddle/utils/pybind.h b/paddle/utils/pybind.h index ae35cf26dfef943abd82cccca55e0364c2f7c87d..3bfe8cf07dcecbcaf99d4fa1267373a104494fef 100644 --- a/paddle/utils/pybind.h +++ b/paddle/utils/pybind.h @@ -40,7 +40,8 @@ typedef struct { bool PyCheckTensor(PyObject* obj); // Internal use only, to expose the Tensor type to Python. -paddle::experimental::Tensor CastPyArg2Tensor(PyObject* obj, ssize_t arg_pos); +paddle::experimental::Tensor CastPyArg2Tensor(PyObject* obj, + Py_ssize_t arg_pos); // Internal use only, to expose the Tensor type to Python. PyObject* ToPyObject(const paddle::experimental::Tensor& value,