Browse Source

fix(device): fix get_device_count for xpu

GitOrigin-RevId: 6c77f507f3
release-1.4
Megvii Engine Team 4 years ago
parent
commit
cfbd4f9bf1
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      imperative/python/megengine/device.py

+ 3
- 1
imperative/python/megengine/device.py View File

@@ -44,7 +44,9 @@ def _str2device_type(type_str: str, allow_unspec: bool = True):
elif type_str == "ROCM" or type_str == "AMDGPU":
return DeviceType.ROCM
else:
assert allow_unspec and str == "XPU", "device type can only be cpu, gpu or xpu"
assert (
allow_unspec and type_str == "XPU"
), "device type can only be cpu, gpu or xpu"
return DeviceType.UNSPEC




Loading…
Cancel
Save