未验证 提交 4557e7e8 编写于 作者: H HongyuJia 提交者: GitHub

[Fix Compile Error] Fix windows+Python3.10 compile error of ssize_t (#50994)

上级 7b6d5ac0
...@@ -31,7 +31,8 @@ bool PyCheckTensor(PyObject* obj) { ...@@ -31,7 +31,8 @@ bool PyCheckTensor(PyObject* obj) {
return PyObject_IsInstance(obj, reinterpret_cast<PyObject*>(p_tensor_type)); return PyObject_IsInstance(obj, reinterpret_cast<PyObject*>(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<PyObject*>(p_tensor_type)) || if (PyObject_IsInstance(obj, reinterpret_cast<PyObject*>(p_tensor_type)) ||
PyObject_IsInstance(obj, PyObject_IsInstance(obj,
reinterpret_cast<PyObject*>(p_string_tensor_type))) { reinterpret_cast<PyObject*>(p_string_tensor_type))) {
......
...@@ -40,7 +40,8 @@ typedef struct { ...@@ -40,7 +40,8 @@ typedef struct {
bool PyCheckTensor(PyObject* obj); bool PyCheckTensor(PyObject* obj);
// Internal use only, to expose the Tensor type to Python. // 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. // Internal use only, to expose the Tensor type to Python.
PyObject* ToPyObject(const paddle::experimental::Tensor& value, PyObject* ToPyObject(const paddle::experimental::Tensor& value,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册