Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 7aa5f65

Browse files
committedMay 6, 2025·
release GIL in constant folding pass
1 parent 7a7f5cb commit 7aa5f65

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed
 

‎paddle/fluid/pybind/inference_api.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,9 @@ void BindInferenceApi(py::module *m) {
592592
m->def("create_predictor",
593593
[](const paddle_infer::Config &config)
594594
-> std::unique_ptr<paddle_infer::Predictor> {
595+
#ifndef PADDLE_NO_PYTHON
596+
pybind11::gil_scoped_release release;
597+
#endif
595598
auto pred = std::make_unique<paddle_infer::Predictor>(config);
596599
return pred;
597600
});

0 commit comments

Comments
 (0)
Please sign in to comment.