forked from mindspore-Ecosystem/mindspore
!18580 Optimize error msg when pyfunc return None
Merge pull request !18580 from xiefangqi/md_fix_python_err_msg
This commit is contained in:
commit
fe4e01a96e
|
@ -61,7 +61,8 @@ Status PyFuncOp::Compute(const TensorRow &input, TensorRow *output) {
|
|||
py::object ret_py_ele = ret_py_tuple[i];
|
||||
// Object is none if pyfunc timeout
|
||||
if (ret_py_ele.is_none()) {
|
||||
MS_LOG(INFO) << "PyFunc execute time out";
|
||||
MS_LOG(INFO) << "Expected that PyFunc should return numpy array, got None. If python_multiprocessing is "
|
||||
"True, PyFunc may execute time out.";
|
||||
goto TimeoutError;
|
||||
}
|
||||
if (!py::isinstance<py::array>(ret_py_ele)) {
|
||||
|
@ -94,7 +95,9 @@ ShapeMisMatch:
|
|||
goto ComputeReturn;
|
||||
|
||||
TimeoutError:
|
||||
ret = Status(StatusCode::kMDTimeOut, __LINE__, __FILE__, "PyFunc execute time out");
|
||||
ret = Status(StatusCode::kMDTimeOut, __LINE__, __FILE__,
|
||||
"Expected that PyFunc should return numpy array, got None. If python_multiprocessing is True, "
|
||||
"PyFunc may execute time out.");
|
||||
goto ComputeReturn;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue