Skip to content

Commit

Permalink
change assertion to set
Browse files Browse the repository at this point in the history
  • Loading branch information
titaiwangms committed Jun 21, 2024
1 parent 522dceb commit 4edd225
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions beginner_source/onnx/onnx_registry_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,10 @@ def custom_aten_add(input_x, input_y, alpha: float = 1.0):
assert len(onnx_program.model_proto.graph.node) == 1
# graph node name is the function name
assert onnx_program.model_proto.graph.node[0].op_type == "custom_aten_add"
# the function has three nodes
assert len(onnx_program.model_proto.functions[0].node) == 3
# function node domain is empty because we use standard ONNX operators
assert onnx_program.model_proto.functions[0].node[2].domain == ""
assert {node.domain for node in onnx_program.model_proto.functions[0].node} == {""}
# function node name is the standard ONNX operator name
assert onnx_program.model_proto.functions[0].node[2].op_type == "Add"
assert {node.op_type for node in onnx_program.model_proto.functions[0].node} == {"Add", "Mul", "Constant"}


######################################################################
Expand Down

0 comments on commit 4edd225

Please sign in to comment.