Commit 1130d5df authored by 源文雨's avatar 源文雨 Committed by GitHub

Update devices.py

parent 76ab31e1
......@@ -6,7 +6,7 @@ from modules import errors
# has_mps is only available in nightly pytorch (for now) and MasOS 12.3+.
# check `getattr` and try it for compatibility
def has_mps() -> bool:
if getattr(torch, 'has_mps', False): return False
if not getattr(torch, 'has_mps', False): return False
try:
torch.zeros(1).to(torch.device("mps"))
return True
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment