aboutsummaryrefslogtreecommitdiffstats
path: root/modules/devices.py
diff options
context:
space:
mode:
author源文雨 <41315874+fumiama@users.noreply.github.com>2022-11-12 03:09:28 +0000
committerGitHub <noreply@github.com>2022-11-12 03:09:28 +0000
commit1130d5df669911a5c67696be90bccca3ecf5f487 (patch)
tree44f72af489dd12770d0e1672fc532e1bbd040c96 /modules/devices.py
parent76ab31e18898d4c2aacb9725cfbe25b230bff974 (diff)
downloadstable-diffusion-webui-gfx803-1130d5df669911a5c67696be90bccca3ecf5f487.tar.gz
stable-diffusion-webui-gfx803-1130d5df669911a5c67696be90bccca3ecf5f487.tar.bz2
stable-diffusion-webui-gfx803-1130d5df669911a5c67696be90bccca3ecf5f487.zip
Update devices.py
Diffstat (limited to 'modules/devices.py')
-rw-r--r--modules/devices.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/devices.py b/modules/devices.py
index 9a3d29d7..bd3e4ffb 100644
--- a/modules/devices.py
+++ b/modules/devices.py
@@ -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