Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
09edd77f
Unverified
Commit
09edd77f
authored
May 06, 2024
by
jiaqianjing
Committed by
GitHub
May 06, 2024
Browse files
Check if the current compiled version of pytorch supports MPS (#30664)
parent
307f632b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
src/transformers/utils/import_utils.py
src/transformers/utils/import_utils.py
+1
-1
No files found.
src/transformers/utils/import_utils.py
View file @
09edd77f
...
@@ -373,7 +373,7 @@ def is_torch_mps_available():
...
@@ -373,7 +373,7 @@ def is_torch_mps_available():
import
torch
import
torch
if
hasattr
(
torch
.
backends
,
"mps"
):
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
return
False
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment