Simplify benchmarks.py assertions (#8515)

pull/8514/head^2
Glenn Jocher 2022-07-07 23:46:55 +02:00 committed by GitHub
parent 3e54651fca
commit f17444abcd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -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 == '-':