From 91a8a25721b0dbdb61d70fc91701214c75851e1a Mon Sep 17 00:00:00 2001 From: Wilber Date: Thu, 7 Jan 2021 14:03:37 +0800 Subject: [PATCH] enhance error info for py_func (#30138) * enhance error info for py_func * update --- paddle/fluid/operators/py_func_op.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/paddle/fluid/operators/py_func_op.cc b/paddle/fluid/operators/py_func_op.cc index 7749903e5f..b3622870d0 100644 --- a/paddle/fluid/operators/py_func_op.cc +++ b/paddle/fluid/operators/py_func_op.cc @@ -112,7 +112,9 @@ static void CallPythonFunc(py::object *callable, out->ShareDataWith(*py_out_tensor); } catch (py::cast_error &) { PADDLE_THROW(platform::errors::InvalidArgument( - "The %d-th output must be LoDTensor.", i)); + "py::cast to LoDTensor error. The %d-th output expection is " + "LoDTensor", + i)); } } }