Skip to content

Commit

Permalink
fix formatting of the python scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
motjuste committed Nov 14, 2024
1 parent bd30d2e commit 69c6aff
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@
print(ipex.__version__)

try:
[print(f"[{i}]: {torch.xpu.get_device_properties(i)}") for i in range(torch.xpu.device_count())];
sys.exit(0)
[
print(f"[{i}]: {torch.xpu.get_device_properties(i)}")
for i in range(torch.xpu.device_count())
]
sys.exit(0)
except Exception:
print("Encountered an error getting XPU device properties", file=sys.stderr)
sys.exit(1)
print("Encountered an error getting XPU device properties", file=sys.stderr)
sys.exit(1)
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
devices = tf.config.experimental.list_physical_devices()
xpu_found = False
for device_str in devices:
if "XPU" in device_str:
xpu_found = True
break
if "XPU" in device_str:
xpu_found = True
break

assert xpu_found, "XPU not found"

0 comments on commit 69c6aff

Please sign in to comment.