diff --git a/lite/core/mir/fusion/conv_activation_fuser.cc b/lite/core/mir/fusion/conv_activation_fuser.cc index 993fe4e9441824d0c5539e6555e5e12d87e5b98f..37e259f3fad6cafdffa84a2b5fab18514bf3c30d 100644 --- a/lite/core/mir/fusion/conv_activation_fuser.cc +++ b/lite/core/mir/fusion/conv_activation_fuser.cc @@ -53,6 +53,14 @@ void ConvActivationFuser::BuildPattern() { void ConvActivationFuser::InsertNewNode(SSAGraph* graph, const key2nodes_t& matched) { + // not fuse quantized conv2d + relu6 for now + auto conv2d_op_desc = matched.at("conv2d")->stmt()->op_info(); + bool is_conv2d_quantized = conv2d_op_desc->HasAttr("enable_int8") && + conv2d_op_desc->GetAttr("enable_int8"); + if (act_type_ == "relu6" && is_conv2d_quantized) { + return; + } + auto op_desc = GenOpDesc(matched); auto conv_op = LiteOpRegistry::Global().Create(conv_type_); auto conv_old = matched.at("conv2d")->stmt()->op();