fix: report correct device count for intel xpu

Former-commit-id: 0618f660b6511599365bd9be64499dbab41a79ba
This commit is contained in:
Zxilly 2024-08-15 08:30:43 +00:00 committed by GitHub
parent 2e257d6af0
commit 3595d26846

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