Skip to content

Commit ddaab0b

Browse files
committed
fix the format issues
Signed-off-by: yisheng <[email protected]>
1 parent 24f0b95 commit ddaab0b

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

accelerator/real_accelerator.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,15 @@ def get_accelerator():
140140
try:
141141
import torch
142142

143-
# torch.xpu supported in upstream pytorch.
143+
# torch.xpu will be supported in upstream pytorch-2.8.
144144
# Currently we can run on xpu device only using pytorch,
145145
# also reserve the old path using ipex when the torch version is old.
146146
if hasattr(torch, 'xpu'):
147-
if torch.cuda.device_count() == 0 and torch.xpu.device_count() > 0 and torch.xpu.is_available():
148-
accelerator_name = "xpu"
149-
else:
150-
pass
147+
if torch.cuda.device_count() == 0: #ignore-cuda
148+
if torch.xpu.device_count() > 0 and torch.xpu.is_available():
149+
accelerator_name = "xpu"
150+
else:
151+
pass
151152
except ImportError as e:
152153
pass
153154
if accelerator_name is None:

0 commit comments

Comments
 (0)