mps.is_available -> mps.is_built

This commit is contained in:
Quentin Gallouédec 2023-10-06 14:45:24 +02:00
parent 1e5dc90a6a
commit 40ed03cddb

View file

@ -521,7 +521,7 @@ def get_available_accelerator() -> str:
Return the available accelerator
(currently checking only for CUDA and MPS device)
"""
if hasattr(th, "has_mps") and th.backends.mps.is_available():
if hasattr(th, "has_mps") and th.backends.mps.is_built():
# MacOS Metal GPU
return "mps"
elif th.cuda.is_available():