From 6756d195c97aafe6b4ee315b8eaeabf255169d37 Mon Sep 17 00:00:00 2001 From: inisis Date: Sun, 15 Sep 2024 02:21:17 +0000 Subject: [PATCH] fix dynamo export bug --- .../third_party/onnx_graphsurgeon/exporters/onnx_exporter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/onnxslim/third_party/onnx_graphsurgeon/exporters/onnx_exporter.py b/onnxslim/third_party/onnx_graphsurgeon/exporters/onnx_exporter.py index 2b949dc..3c021aa 100644 --- a/onnxslim/third_party/onnx_graphsurgeon/exporters/onnx_exporter.py +++ b/onnxslim/third_party/onnx_graphsurgeon/exporters/onnx_exporter.py @@ -159,7 +159,7 @@ def export_value_info_proto(tensor: Tensor, do_type_check: bool) -> onnx.ValueIn return onnx_tensor @staticmethod - def export_attributes(attrs: dict, subgraph_tensor_map) -> List[onnx.AttributeProto]: + def export_attributes(attrs: dict, subgraph_tensor_map=None) -> List[onnx.AttributeProto]: """Convert function attributes to ONNX AttributeProtos for model export.""" onnx_attrs: List[onnx.AttributeProto] = [] for key, val in attrs.items(): @@ -192,7 +192,7 @@ def export_attributes(attrs: dict, subgraph_tensor_map) -> List[onnx.AttributePr return onnx_attrs @staticmethod - def export_node(node: Node, subgraph_tensor_map) -> onnx.NodeProto: + def export_node(node: Node, subgraph_tensor_map=None) -> onnx.NodeProto: # Cannot pass in attrs directly as make_node will change the order """Static method to convert an internal node to an ONNX node representation.""" onnx_node = onnx.helper.make_node(