From d19a637959d0d8170c4f15faccd5314bb55a6931 Mon Sep 17 00:00:00 2001 From: Megvii Engine Team Date: Mon, 25 May 2020 16:03:27 +0800 Subject: [PATCH] fix(python_module): hold GIL during _get_serialized_dtype GitOrigin-RevId: 6b7288bd0c72af0dd163e3cbee9c9869871c764b --- python_module/src/swig/misc.i | 1 + 1 file changed, 1 insertion(+) diff --git a/python_module/src/swig/misc.i b/python_module/src/swig/misc.i index cb7542634..8b343058f 100644 --- a/python_module/src/swig/misc.i +++ b/python_module/src/swig/misc.i @@ -125,6 +125,7 @@ struct _OptimizeForInferenceOptions { } PyObject* _get_serialized_dtype(PyObject *dtype) { + PYTHON_GIL; std::string sdtype; auto write = [&sdtype](const void* data, size_t size) { auto pos = sdtype.size(); -- GitLab