From 8b1c8086f82fb8cc0bf1e08ddf900a2e2801f4c5 Mon Sep 17 00:00:00 2001 From: inisis Date: Thu, 31 Oct 2024 21:41:32 +0800 Subject: [PATCH] fix missed add elimination --- onnxslim/core/optimization/dead_node_elimination.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onnxslim/core/optimization/dead_node_elimination.py b/onnxslim/core/optimization/dead_node_elimination.py index 6985124..2ab7445 100644 --- a/onnxslim/core/optimization/dead_node_elimination.py +++ b/onnxslim/core/optimization/dead_node_elimination.py @@ -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":