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)); } } }