Skip to content

Commit 1ce291c

Browse files
authored
[IR] Fix deserialize_node (#2098)
`ir.from_proto` raises an exception for `NodeProto` input type. Here this error is fixed. Close #2093
1 parent c634313 commit 1ce291c

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)