Skip to content

Commit

Permalink
skip tied constant folding
Browse files Browse the repository at this point in the history
  • Loading branch information
inisis committed Jun 6, 2024
1 parent c095a5d commit 4688a64
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion onnxslim/onnx_graphsurgeon/ir/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,7 @@ def all_tensors_const(tensors):
graph_constants.update({out.name: out for out in node.outputs})
return graph_constants

graph_constants = {name: tensor for name, tensor in clone_tensors.items() if isinstance(tensor, Constant)}
graph_constants = {name: tensor for name, tensor in clone_tensors.items() if (isinstance(tensor, Constant) and len(tensor.outputs) == 1)}
graph_constants = update_foldable_outputs(graph_constants)

# Pass 4: Shape Folding
Expand Down

0 comments on commit 4688a64

Please sign in to comment.