diff --git a/paddle/fluid/pybind/eager_py_layer.cc b/paddle/fluid/pybind/eager_py_layer.cc index a0cef6388c13f2f328dfe2c64c6a4391875a55f3..55d9f972db8729498fd2aad543b7a979e4928cbf 100644 --- a/paddle/fluid/pybind/eager_py_layer.cc +++ b/paddle/fluid/pybind/eager_py_layer.cc @@ -240,6 +240,8 @@ PyObject* pylayer_method_apply(PyObject* cls, PyObject* args, PyObject* outputs_tuple = nullptr; if (PyTuple_Check(outputs)) { outputs_tuple = outputs; + } else if (PyList_Check(outputs)) { + outputs_tuple = PyList_AsTuple(outputs); } else { outputs_tuple = PyTuple_New(1); Py_INCREF(outputs);