Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] authored and DamianSzwichtenberg committed Jul 10, 2023
1 parent a69eefa commit b14c947
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions benchmark/inference/inference_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ def run(args: argparse.ArgumentParser):
except ImportError:
raise RuntimeError('XPU device requires IPEX to be installed')

if ((args.device == 'cuda' and not torch.cuda.is_available()) or
(args.device == 'xpu' and not torch.xpu.is_available())):
if ((args.device == 'cuda' and not torch.cuda.is_available())
or (args.device == 'xpu' and not torch.xpu.is_available())):
raise RuntimeError(f'{args.device.upper()} is not available')

if args.device == 'cuda' and args.full_batch:
Expand Down Expand Up @@ -195,7 +195,7 @@ def run(args: argparse.ArgumentParser):
profile = xpu_profiler(args.export_chrome_trace)
elif args.profile:
profile = torch_profile(args.export_chrome_trace,
csv_data, args.write_csv)
csv_data, args.write_csv)
else:
profile = nullcontext()
itt = emit_itt(
Expand Down
1 change: 1 addition & 0 deletions benchmark/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
try:
from torch.autograd.profiler import emit_itt
except ImportError:

@contextmanager
def emit_itt(*args, **kwargs):
yield
Expand Down

0 comments on commit b14c947

Please sign in to comment.