Skip to content
This repository was archived by the owner on Aug 7, 2025. It is now read-only.

Commit 13d6dbb

Browse files
committed
lint
1 parent 199df57 commit 13d6dbb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/pytest/test_example_intel_extension_for_pytorch.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@
2222
xeon_run_cpu_available = True
2323

2424
ipex_available = False
25-
try:
26-
import intel_extension_for_pytorch as ipex
25+
cmd = ["python", "-c", "import intel_extension_for_pytorch as ipex"]
26+
r = subprocess.run(cmd)
27+
if r.returncode == 0:
2728
ipex_available = True
28-
except ImportError as error:
29-
ipex_available = False
3029

3130
ipex_xeon_run_cpu_available = xeon_run_cpu_available and ipex_available
3231

32+
3333
def setup_module():
3434
test_utils.torchserve_cleanup()
3535
response = requests.get(

0 commit comments

Comments
 (0)