Browse Source
update
Signed-off-by: Jael Gu <mengjia.gu@zilliz.com>
main
2 changed files with
6 additions and
6 deletions
-
test_onnx.py
-
test_torchscript.py
|
@ -87,14 +87,14 @@ for name in models: |
|
|
out1 = op(data) |
|
|
out1 = op(data) |
|
|
f.write('success,') |
|
|
f.write('success,') |
|
|
except Exception as e: |
|
|
except Exception as e: |
|
|
f.write('fail') |
|
|
|
|
|
|
|
|
f.write('fail\n') |
|
|
print(f'Fail to load op for {name}: {e}') |
|
|
print(f'Fail to load op for {name}: {e}') |
|
|
continue |
|
|
continue |
|
|
try: |
|
|
try: |
|
|
op.save_model(format='onnx') |
|
|
op.save_model(format='onnx') |
|
|
f.write('success,') |
|
|
f.write('success,') |
|
|
except Exception as e: |
|
|
except Exception as e: |
|
|
f.write('fail') |
|
|
|
|
|
|
|
|
f.write('fail\n') |
|
|
print(f'Fail to save onnx for {name}: {e}') |
|
|
print(f'Fail to save onnx for {name}: {e}') |
|
|
continue |
|
|
continue |
|
|
try: |
|
|
try: |
|
@ -103,7 +103,7 @@ for name in models: |
|
|
onnx.checker.check_model(onnx_model) |
|
|
onnx.checker.check_model(onnx_model) |
|
|
f.write('success') |
|
|
f.write('success') |
|
|
except Exception as e: |
|
|
except Exception as e: |
|
|
f.write('fail') |
|
|
|
|
|
|
|
|
f.write('fail\n') |
|
|
print(f'Fail to check onnx for {name}: {e}') |
|
|
print(f'Fail to check onnx for {name}: {e}') |
|
|
continue |
|
|
continue |
|
|
f.write('\n') |
|
|
f.write('\n') |
|
|
|
@ -87,14 +87,14 @@ for name in models: |
|
|
out1 = op(data) |
|
|
out1 = op(data) |
|
|
f.write('success,') |
|
|
f.write('success,') |
|
|
except Exception as e: |
|
|
except Exception as e: |
|
|
f.write('fail') |
|
|
|
|
|
|
|
|
f.write('fail\n') |
|
|
print(f'Fail to load op for {name}: {e}') |
|
|
print(f'Fail to load op for {name}: {e}') |
|
|
continue |
|
|
continue |
|
|
try: |
|
|
try: |
|
|
op.save_model(format='torchscript') |
|
|
op.save_model(format='torchscript') |
|
|
f.write('success,') |
|
|
f.write('success,') |
|
|
except Exception as e: |
|
|
except Exception as e: |
|
|
f.write('fail') |
|
|
|
|
|
|
|
|
f.write('fail\n') |
|
|
print(f'Fail to save onnx for {name}: {e}') |
|
|
print(f'Fail to save onnx for {name}: {e}') |
|
|
continue |
|
|
continue |
|
|
try: |
|
|
try: |
|
@ -104,7 +104,7 @@ for name in models: |
|
|
assert (out1 == out2).all() |
|
|
assert (out1 == out2).all() |
|
|
f.write('success') |
|
|
f.write('success') |
|
|
except Exception as e: |
|
|
except Exception as e: |
|
|
f.write('fail') |
|
|
|
|
|
|
|
|
f.write('fail\n') |
|
|
print(f'Fail to check onnx for {name}: {e}') |
|
|
print(f'Fail to check onnx for {name}: {e}') |
|
|
continue |
|
|
continue |
|
|
f.write('\n') |
|
|
f.write('\n') |
|
|