Skip to content

Commit ef2c671

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

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

accelerator/real_accelerator.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,11 @@ def get_accelerator():
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)