glenn-jocher commited on
Commit
f17444a
·
unverified ·
1 Parent(s): 3e54651

Simplify benchmarks.py assertions (#8515)

Browse files
Files changed (1) hide show
  1. utils/benchmarks.py +4 -4
utils/benchmarks.py CHANGED
@@ -61,12 +61,12 @@ def run(
61
  device = select_device(device)
62
  for i, (name, f, suffix, cpu, gpu) in export.export_formats().iterrows(): # index, (name, file, suffix, CPU, GPU)
63
  try:
64
- assert i not in (9, 10), f'{name} inference not supported' # Edge TPU and TF.js are unsupported
65
- assert i != 5 or platform.system() == 'Darwin', f'{name} inference only supported on macOS>=10.13'
66
  if 'cpu' in device.type:
67
- assert cpu, f'{name} inference not supported on CPU'
68
  if 'cuda' in device.type:
69
- assert gpu, f'{name} inference not supported on GPU'
70
 
71
  # Export
72
  if f == '-':
 
61
  device = select_device(device)
62
  for i, (name, f, suffix, cpu, gpu) in export.export_formats().iterrows(): # index, (name, file, suffix, CPU, GPU)
63
  try:
64
+ assert i not in (9, 10), 'inference not supported' # Edge TPU and TF.js are unsupported
65
+ assert i != 5 or platform.system() == 'Darwin', 'inference only supported on macOS>=10.13' # CoreML
66
  if 'cpu' in device.type:
67
+ assert cpu, 'inference not supported on CPU'
68
  if 'cuda' in device.type:
69
+ assert gpu, 'inference not supported on GPU'
70
 
71
  # Export
72
  if f == '-':