We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 24f0b95 commit ef2c671Copy full SHA for ef2c671
accelerator/real_accelerator.py
@@ -144,10 +144,11 @@ def get_accelerator():
144
# Currently we can run on xpu device only using pytorch,
145
# also reserve the old path using ipex when the torch version is old.
146
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
+ if torch.cuda.device_count() == 0: #ignore-cuda
+ if torch.xpu.device_count() > 0 and torch.xpu.is_available():
+ accelerator_name = "xpu"
+ else:
151
+ pass
152
except ImportError as e:
153
pass
154
if accelerator_name is None:
0 commit comments