Skip to content

Commit 522dceb

Browse files
committed
add length assertion
1 parent 50cc591 commit 522dceb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

beginner_source/onnx/onnx_registry_tutorial.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ def custom_aten_add(input_x, input_y, alpha: float = 1.0):
128128
assert len(onnx_program.model_proto.graph.node) == 1
129129
# graph node name is the function name
130130
assert onnx_program.model_proto.graph.node[0].op_type == "custom_aten_add"
131+
# the function has three nodes
132+
assert len(onnx_program.model_proto.functions[0].node) == 3
131133
# function node domain is empty because we use standard ONNX operators
132134
assert onnx_program.model_proto.functions[0].node[2].domain == ""
133135
# function node name is the standard ONNX operator name

0 commit comments

Comments
 (0)