Skip to content

Commit

Permalink
fix subgraph bug
Browse files Browse the repository at this point in the history
  • Loading branch information
inisis committed Jun 26, 2024
1 parent fc51881 commit 0218a0b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion onnxslim/onnx_graphsurgeon/exporters/onnx_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ def export_graph(
for tensor in tensor_map.values()
if isinstance(tensor, Constant) and not isinstance(tensor._values, SparseValues)
]

sparse_initializer = [
OnnxExporter.export_sparse_tensor_proto(tensor)
for tensor in tensor_map.values()
Expand Down Expand Up @@ -356,7 +357,7 @@ def export_onnx(graph: Graph, do_type_check=True, **kwargs) -> "onnx.ModelProto"
)

onnx_graph = OnnxExporter.export_graph(
graph, tensor_map=intersection, subgraph_tensor_map=intersection, do_type_check=do_type_check
graph, tensor_map=graph.tensors(), subgraph_tensor_map=intersection, do_type_check=do_type_check
)
onnx_functions = [OnnxExporter.export_function(func) for func in graph.functions]
kwargs["functions"] = onnx_functions
Expand Down
2 changes: 2 additions & 0 deletions onnxslim/onnx_graphsurgeon/util/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ def combine_dicts(dict0, dict1):
Values in the second will overwrite values in the first.
"""
if dict1 is None:
return dict0
combined = OrderedDict()
combined.update(dict0)
combined.update(dict1)
Expand Down

0 comments on commit 0218a0b

Please sign in to comment.