Unverified 提交 f17444ab authored 作者: Glenn Jocher's avatar Glenn Jocher 提交者: GitHub

Simplify benchmarks.py assertions (#8515)

上级 3e54651f
...@@ -61,12 +61,12 @@ def run( ...@@ -61,12 +61,12 @@ def run(
device = select_device(device) device = select_device(device)
for i, (name, f, suffix, cpu, gpu) in export.export_formats().iterrows(): # index, (name, file, suffix, CPU, GPU) for i, (name, f, suffix, cpu, gpu) in export.export_formats().iterrows(): # index, (name, file, suffix, CPU, GPU)
try: try:
assert i not in (9, 10), f'{name} inference not supported' # Edge TPU and TF.js are unsupported assert i not in (9, 10), '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 != 5 or platform.system() == 'Darwin', 'inference only supported on macOS>=10.13' # CoreML
if 'cpu' in device.type: 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: if 'cuda' in device.type:
assert gpu, f'{name} inference not supported on GPU' assert gpu, 'inference not supported on GPU'
# Export # Export
if f == '-': if f == '-':
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论