Skip to content

Commit b4deb62

Browse files
committed
add onnx checker
1 parent 56d21f0 commit b4deb62

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

python/tvm/relay/frontend/onnx.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,6 +1133,13 @@ def from_onnx(model,
11331133
params : dict of str to tvm.NDArray
11341134
The parameter dict to be used by relay
11351135
"""
1136+
try:
1137+
from onnx import checker
1138+
if hasattr(checker, 'check_model'):
1139+
# try use onnx's own model checker before converting any model
1140+
checker.check_model(model)
1141+
except ImportError:
1142+
pass
11361143
g = GraphProto(shape, dtype)
11371144
graph = model.graph
11381145
try:

0 commit comments

Comments
 (0)