Skip to content

Commit ca9f8eb

Browse files
authored
revert ipex import (#1803)
Signed-off-by: yiliu30 <[email protected]>
1 parent 4f893ca commit ca9f8eb

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

neural_compressor/torch/utils/environ.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,20 @@ def is_hpex_available():
3131
return _hpex_available
3232

3333

34-
def is_ipex_available():
35-
try:
36-
import intel_extension_for_pytorch as ipex
34+
try:
35+
import intel_extension_for_pytorch as ipex
36+
37+
_ipex_available = True
38+
except:
39+
_ipex_available = False
40+
3741

38-
_ipex_available = True
39-
except:
40-
_ipex_available = False
42+
def is_ipex_available():
4143
return _ipex_available
4244

4345

4446
def get_ipex_version():
4547
if is_ipex_available():
46-
import intel_extension_for_pytorch as ipex
47-
4848
try:
4949
ipex_version = ipex.__version__.split("+")[0]
5050
except ValueError as e: # pragma: no cover

0 commit comments

Comments
 (0)