diff --git a/ortools/graph/python/linear_sum_assignment.cc b/ortools/graph/python/linear_sum_assignment.cc index e821ba350d..8b6c662b7b 100644 --- a/ortools/graph/python/linear_sum_assignment.cc +++ b/ortools/graph/python/linear_sum_assignment.cc @@ -20,7 +20,7 @@ using ::operations_research::SimpleLinearSumAssignment; using NodeIndex = ::operations_research::SimpleLinearSumAssignment::NodeIndex; using ::pybind11::arg; -PYBIND11_MODULE(linear_sum_assignment, m) { +PYBIND11_MODULE(linear_sum_assignment, m, pybind11::mod_gil_not_used()) { pybind11::class_ slsa(m, "SimpleLinearSumAssignment"); slsa.def(pybind11::init<>()); diff --git a/ortools/graph/python/max_flow.cc b/ortools/graph/python/max_flow.cc index b9c04cebac..947b9d9eef 100644 --- a/ortools/graph/python/max_flow.cc +++ b/ortools/graph/python/max_flow.cc @@ -22,7 +22,7 @@ using ::operations_research::SimpleMaxFlow; using ::pybind11::arg; -PYBIND11_MODULE(max_flow, m) { +PYBIND11_MODULE(max_flow, m, pybind11::mod_gil_not_used()) { pybind11::class_ smf(m, "SimpleMaxFlow"); smf.def(pybind11::init<>()); smf.def("add_arc_with_capacity", &SimpleMaxFlow::AddArcWithCapacity, diff --git a/ortools/graph/python/min_cost_flow.cc b/ortools/graph/python/min_cost_flow.cc index d297ea9930..8e03f6c1aa 100644 --- a/ortools/graph/python/min_cost_flow.cc +++ b/ortools/graph/python/min_cost_flow.cc @@ -21,7 +21,7 @@ using ::operations_research::MinCostFlowBase; using ::operations_research::SimpleMinCostFlow; using ::pybind11::arg; -PYBIND11_MODULE(min_cost_flow, m) { +PYBIND11_MODULE(min_cost_flow, m, pybind11::mod_gil_not_used()) { pybind11::class_ smcf(m, "SimpleMinCostFlow"); smcf.def(pybind11::init<>()); smcf.def("add_arc_with_capacity_and_unit_cost",