tiny fix
Former-commit-id: 23961bdf6fdbcde64e7b943f699fdeb4ac024043
This commit is contained in:
@@ -137,12 +137,12 @@ def get_device_count() -> int:
|
||||
r"""
|
||||
Gets the number of available GPU or NPU devices.
|
||||
"""
|
||||
if is_torch_npu_available():
|
||||
if is_torch_xpu_available():
|
||||
return torch.xpu.device_count()
|
||||
elif is_torch_npu_available():
|
||||
return torch.npu.device_count()
|
||||
elif is_torch_cuda_available():
|
||||
return torch.cuda.device_count()
|
||||
elif is_torch_xpu_available():
|
||||
return torch.xpu.device_count()
|
||||
else:
|
||||
return 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user