From 17f2dffb5bd7cfe70d3f8072d5b312470df85d7b Mon Sep 17 00:00:00 2001 From: Megvii Engine Team Date: Fri, 21 Jan 2022 16:30:06 +0800 Subject: [PATCH] fix(imperative/cpu/multithread): fix multithread at imperative GitOrigin-RevId: 9120d5cb48e1087f38a826d377ca3c6bae984730 --- imperative/python/megengine/device.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/imperative/python/megengine/device.py b/imperative/python/megengine/device.py index 9ba1c4d64..d9a8f2a7a 100644 --- a/imperative/python/megengine/device.py +++ b/imperative/python/megengine/device.py @@ -50,7 +50,9 @@ _sh = _stream_helper() def _valid_device(inp): - if isinstance(inp, str) and re.match("^([cxg]pu|rocm)(\d+|\d+:\d+|x)$", inp): + if isinstance(inp, str) and re.match( + "^([cxg]pu|rocm|multithread)(\d+|\d+:\d+|x)$", inp + ): return True return False -- GitLab