From 0e51815d17e67ab85e11459006580bb62d9c2af1 Mon Sep 17 00:00:00 2001 From: inisis Date: Wed, 13 Nov 2024 01:37:06 +0800 Subject: [PATCH] fix convbn fusion bug --- onnxslim/core/pattern/fusion/convbn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onnxslim/core/pattern/fusion/convbn.py b/onnxslim/core/pattern/fusion/convbn.py index f4aa0e0..56f1e13 100644 --- a/onnxslim/core/pattern/fusion/convbn.py +++ b/onnxslim/core/pattern/fusion/convbn.py @@ -29,7 +29,7 @@ def rewrite(self, opset=11): conv_transpose_node = self.conv_0 conv_transpose_node_users = get_node_users(conv_transpose_node) node = self.bn_0 - if len(conv_transpose_node_users) == 1: + if len(conv_transpose_node_users) == 1 and all([isinstance(value, gs.Constant) for value in node.inputs[1:]]): conv_transpose_weight = conv_transpose_node.inputs[1].values bn_node = node bn_scale = bn_node.inputs[1].values