mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-01-31 02:32:57 +08:00
Update devices.py
This commit is contained in:
parent
76ab31e188
commit
1130d5df66
@ -6,7 +6,7 @@ from modules import errors
|
|||||||
# has_mps is only available in nightly pytorch (for now) and MasOS 12.3+.
|
# has_mps is only available in nightly pytorch (for now) and MasOS 12.3+.
|
||||||
# check `getattr` and try it for compatibility
|
# check `getattr` and try it for compatibility
|
||||||
def has_mps() -> bool:
|
def has_mps() -> bool:
|
||||||
if getattr(torch, 'has_mps', False): return False
|
if not getattr(torch, 'has_mps', False): return False
|
||||||
try:
|
try:
|
||||||
torch.zeros(1).to(torch.device("mps"))
|
torch.zeros(1).to(torch.device("mps"))
|
||||||
return True
|
return True
|
||||||
|
Loading…
Reference in New Issue
Block a user