Skip to content

Commit 1130d5d

Browse files
authored
Update devices.py
1 parent 76ab31e commit 1130d5d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/devices.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# has_mps is only available in nightly pytorch (for now) and MasOS 12.3+.
77
# check `getattr` and try it for compatibility
88
def has_mps() -> bool:
9-
if getattr(torch, 'has_mps', False): return False
9+
if not getattr(torch, 'has_mps', False): return False
1010
try:
1111
torch.zeros(1).to(torch.device("mps"))
1212
return True

0 commit comments

Comments
 (0)