Skip to content

Commit 8683ca1

Browse files
committed
Fix typo (pytorch#694)
`torch.zero`->`torch.zeros`, as former does not exist. Also, capture only `RuntimeErrors` to avoid making such typos in the future
1 parent 46291a9 commit 8683ca1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

build/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,8 @@ def is_mps_available() -> bool:
227227
# out system says mps is available, but it's not on VMs
228228
# so let's set up some memry, and see if that work:
229229
try:
230-
mps_tensor = torch.zero(1024, dtype=torch.float16, device="mps")
231-
except:
230+
mps_tensor = torch.zeros(1024, dtype=torch.float16, device="mps")
231+
except RuntimeError:
232232
return False
233233

234234
# MPS, is that you?

0 commit comments

Comments
 (0)