We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 76ab31e commit 1130d5dCopy full SHA for 1130d5d
modules/devices.py
@@ -6,7 +6,7 @@
6
# has_mps is only available in nightly pytorch (for now) and MasOS 12.3+.
7
# check `getattr` and try it for compatibility
8
def has_mps() -> bool:
9
- if getattr(torch, 'has_mps', False): return False
+ if not getattr(torch, 'has_mps', False): return False
10
try:
11
torch.zeros(1).to(torch.device("mps"))
12
return True
0 commit comments