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
renzhc
diffusers_dcu
Commits
1c6ab9e9
Unverified
Commit
1c6ab9e9
authored
Jul 10, 2025
by
Sayak Paul
Committed by
GitHub
Jul 10, 2025
Browse files
[utils] account for MPS when available in get_device(). (#11905)
* account for MPS when available in get_device(). * fix
parent
265840a0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
src/diffusers/utils/torch_utils.py
src/diffusers/utils/torch_utils.py
+2
-0
No files found.
src/diffusers/utils/torch_utils.py
View file @
1c6ab9e9
...
...
@@ -175,6 +175,8 @@ def get_device():
return
"npu"
elif
hasattr
(
torch
,
"xpu"
)
and
torch
.
xpu
.
is_available
():
return
"xpu"
elif
torch
.
backends
.
mps
.
is_available
():
return
"mps"
else
:
return
"cpu"
...
...
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