Skip to content

Commit 32c0b3c

Browse files
committed
[Test] extra opset v checks in test_customop_version
1 parent 94cf223 commit 32c0b3c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tests/custom_op/test_customop_version.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,13 @@ def test_customop_version():
119119
# fetching of op version
120120
inst = model.get_customop_wrapper(model.graph.node[0])
121121
assert inst.get_nodeattr(f"v{ver}_attr") == ver
122+
assert inst.onnx_opset_version == ver
122123
# explicitly specify onnx_opset_version in getCustomOp
123124
# note: new code should avoid calling getCustomOp directly like this
124125
# and instead use ModelWrapper.get_customop_wrapper
125126
inst = getCustomOp(model.graph.node[0], onnx_opset_version=ver)
126127
assert inst.get_nodeattr(f"v{ver}_attr") == ver
128+
assert inst.onnx_opset_version == ver
127129
# unspecified version getCustomOp should default to v1 handler
128130
model = make_vertest_model(1, False)
129131
inst = getCustomOp(model.graph.node[0])
@@ -132,3 +134,4 @@ def test_customop_version():
132134
model = make_vertest_model(3, False)
133135
inst = getCustomOp(model.graph.node[0], onnx_opset_version=4)
134136
assert isinstance(inst, VerTestOp_v3)
137+
assert inst.onnx_opset_version == 3

0 commit comments

Comments
 (0)