Skip to content

Commit 86643c5

Browse files
committed
fix(ir): update scoped_values (#2093)
Show there is a bug when deserializing NodeProto with inputs/outputs. For deserialize to work without context, it is necessary that the first element be an empty dict.
1 parent db02e3f commit 86643c5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

onnxscript/ir/serde.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,7 @@ def _deserialize_attribute(
958958

959959
def deserialize_node(proto: onnx.NodeProto) -> _core.Node:
960960
return _deserialize_node(
961-
proto, scoped_values=[], value_info={}, quantization_annotations={}
961+
proto, scoped_values=[{}], value_info={}, quantization_annotations={}
962962
)
963963

964964

onnxscript/ir/serde_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class ConvenienceFunctionsTest(unittest.TestCase):
1818
[
1919
("model", onnx.ModelProto()),
2020
("graph", onnx.GraphProto()),
21-
("node", onnx.NodeProto()),
21+
("node", onnx.NodeProto(input=["X"], output=["Y"])),
2222
(
2323
"tensor",
2424
onnx.helper.make_tensor("test_tensor", onnx.TensorProto.FLOAT, [1], [1.0]),

0 commit comments

Comments
 (0)