File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments