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 635f6ab commit a2b9990Copy full SHA for a2b9990
accelerator/real_accelerator.py
@@ -131,17 +131,22 @@ def get_accelerator():
131
if accelerator_name is None:
132
try:
133
import intel_extension_for_pytorch as ipex
134
+
135
if ipex._C._has_xpu():
136
accelerator_name = "xpu"
137
except ImportError as e:
138
+ pass
139
+ if accelerator_name is None:
140
+ try:
141
import torch
142
143
if hasattr(torch, 'xpu'):
144
if torch.xpu.is_available():
145
146
else:
147
pass
- else:
- pass
148
+ except ImportError as e:
149
150
151
152
import torch_npu # noqa: F401,F811 # type: ignore
0 commit comments