Skip to content

Commit

Permalink
fix missed add elimination
Browse files Browse the repository at this point in the history
  • Loading branch information
inisis committed Oct 31, 2024
1 parent b76595b commit 8b1c808
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion onnxslim/core/optimization/dead_node_elimination.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def dead_node_elimination(graph, is_subgraph=False):
if value.ndim == 0 and value == 0:
delete_node(node, var_idx)
logger.debug(f"removing {node.op} op: {node.name}")
elif np.all(value == 0) and (node.inputs[0].shape == node.outputs[0].shape):
elif np.all(value == 0) and (node.inputs[var_idx].shape == node.outputs[0].shape):
delete_node(node, var_idx)
logger.debug(f"removing {node.op} op: {node.name}")
elif node.op == "Expand":
Expand Down

0 comments on commit 8b1c808

Please sign in to comment.