From c53e92fc66103e0da0dd39f22d1fb61da1c56d60 Mon Sep 17 00:00:00 2001 From: wanghuancoder Date: Wed, 14 Sep 2022 16:34:51 +0800 Subject: [PATCH] CastPyArg2IntArray use int64_t (#45919) --- paddle/fluid/pybind/eager_utils.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/paddle/fluid/pybind/eager_utils.cc b/paddle/fluid/pybind/eager_utils.cc index c4dbd905de8..df09dd7ec0a 100644 --- a/paddle/fluid/pybind/eager_utils.cc +++ b/paddle/fluid/pybind/eager_utils.cc @@ -1387,14 +1387,12 @@ paddle::experimental::IntArray CastPyArg2IntArray(PyObject* obj, auto type_name = std::string(type->tp_name); if (type_name == "list" || type_name == "tuple" || type_name == "numpy.ndarray") { - std::vector value = CastPyArg2Ints(obj, op_type, arg_pos); + std::vector value = CastPyArg2Longs(obj, op_type, arg_pos); return paddle::experimental::IntArray(value); - } else if (type_name == "paddle.Tensor" || type_name == "Tensor") { paddle::experimental::Tensor& value = GetTensorFromPyObject( op_type, "" /*arg_name*/, obj, arg_pos, false /*dispensable*/); return paddle::experimental::IntArray(value); - } else { PADDLE_THROW(platform::errors::InvalidArgument( "%s(): argument (position %d) must be " -- GitLab