From 44e59125fb3c497f0081ef1b171a92481a5b65e1 Mon Sep 17 00:00:00 2001 From: Joshua Lochner Date: Wed, 19 Jun 2024 10:51:53 +0200 Subject: [PATCH] [Bug Fix] Add missing line (#11) --- onnxslim/core/optimizer.py | 1 + 1 file changed, 1 insertion(+) diff --git a/onnxslim/core/optimizer.py b/onnxslim/core/optimizer.py index 8c75145..25fbf9b 100644 --- a/onnxslim/core/optimizer.py +++ b/onnxslim/core/optimizer.py @@ -157,6 +157,7 @@ def graph_constant_fold_inplace(graph): delete_node(node, idx) logger.debug(f"removing Add op: {node.name}") elif node.op == "Expand": + idx, constant_variable = get_constant_variable(node, return_idx=True) if len(node.inputs) > 1 and isinstance(node.inputs[1], Constant) and np.all(node.inputs[1].values == 1): idx = 0 if idx == 1 else 1 delete_node(node, idx)