mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-31 02:02:21 +06:00
Check if the current compiled version of pytorch supports MPS (#30664)
This commit is contained in:
parent
307f632bb2
commit
09edd77f64
@ -373,7 +373,7 @@ def is_torch_mps_available():
|
||||
import torch
|
||||
|
||||
if hasattr(torch.backends, "mps"):
|
||||
return torch.backends.mps.is_available()
|
||||
return torch.backends.mps.is_available() and torch.backends.mps.is_built()
|
||||
return False
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user