Merge pull request #5188 from Zxilly/main

fix: report correct device count for intel xpu
This commit is contained in:
hoshi-hiyouga 2024-08-19 23:51:39 +08:00 committed by GitHub
commit d39f4a62d3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 0 deletions

View File

@ -141,6 +141,8 @@ def get_device_count() -> int:
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