未验证 提交 1df354e7 编写于 作者: W Wilber 提交者: GitHub

fix python ascend run error. (#38605)

上级 20dc1ac2
......@@ -742,7 +742,13 @@ void BindPaddleInferPredictor(py::module *m) {
.def("get_output_names", &paddle_infer::Predictor::GetOutputNames)
.def("get_input_handle", &paddle_infer::Predictor::GetInputHandle)
.def("get_output_handle", &paddle_infer::Predictor::GetOutputHandle)
.def("run", &paddle_infer::Predictor::Run)
.def("run",
[](paddle_infer::Predictor &self) {
#ifdef PADDLE_WITH_ASCEND_CL
pybind11::gil_scoped_release release;
#endif
self.Run();
})
.def("clone", &paddle_infer::Predictor::Clone)
.def("try_shrink_memory", &paddle_infer::Predictor::TryShrinkMemory)
.def("clear_intermediate_tensor",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册