Skip to content

Commit

Permalink
Simplify benchmarks.py assertions (#8515)
Browse files Browse the repository at this point in the history
  • Loading branch information
glenn-jocher committed Jul 7, 2022
1 parent 3e54651 commit f17444a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions utils/benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ def run(
device = select_device(device)
for i, (name, f, suffix, cpu, gpu) in export.export_formats().iterrows(): # index, (name, file, suffix, CPU, GPU)
try:
assert i not in (9, 10), f'{name} inference not supported' # Edge TPU and TF.js are unsupported
assert i != 5 or platform.system() == 'Darwin', f'{name} inference only supported on macOS>=10.13'
assert i not in (9, 10), 'inference not supported' # Edge TPU and TF.js are unsupported
assert i != 5 or platform.system() == 'Darwin', 'inference only supported on macOS>=10.13' # CoreML
if 'cpu' in device.type:
assert cpu, f'{name} inference not supported on CPU'
assert cpu, 'inference not supported on CPU'
if 'cuda' in device.type:
assert gpu, f'{name} inference not supported on GPU'
assert gpu, 'inference not supported on GPU'

# Export
if f == '-':
Expand Down

0 comments on commit f17444a

Please sign in to comment.