mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-29 20:14:01 +00:00
Scoped GIL release in run_with_iobinding (#11248)
This commit is contained in:
parent
dec99657a1
commit
98faaa7e2f
1 changed files with 2 additions and 0 deletions
|
|
@ -1547,6 +1547,8 @@ including arg name, arg type (contains both type and shape).)pbdoc")
|
|||
py::return_value_policy::reference_internal)
|
||||
.def("run_with_iobinding", [](PyInferenceSession* sess, SessionIOBinding& io_binding, RunOptions* run_options = nullptr) -> void {
|
||||
Status status;
|
||||
// release GIL to allow multiple python threads to invoke Run() in parallel.
|
||||
py::gil_scoped_release release;
|
||||
if (!run_options)
|
||||
status = sess->GetSessionHandle()->Run(*io_binding.Get());
|
||||
else
|
||||
|
|
|
|||
Loading…
Reference in a new issue