From 3e7359e48f0b4b87e765c697a2af6e255757e060 Mon Sep 17 00:00:00 2001 From: HappyAngel Date: Fri, 25 Sep 2020 12:26:31 +0800 Subject: [PATCH] fix conv_conv fusion error in conv_dw+conv_1x1 (#4446) * fix conv_conv fusion error in conv_dw+conv_1x1. test=develop * test=develop * fix format. test=develop --- lite/core/mir/fusion/conv_conv_fuse_pass.cc | 2 +- lite/core/mir/fusion/conv_conv_fuser.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lite/core/mir/fusion/conv_conv_fuse_pass.cc b/lite/core/mir/fusion/conv_conv_fuse_pass.cc index b2c5d8d15a..e7f816ae4c 100644 --- a/lite/core/mir/fusion/conv_conv_fuse_pass.cc +++ b/lite/core/mir/fusion/conv_conv_fuse_pass.cc @@ -27,7 +27,7 @@ namespace mir { void ConvConvFusePass::Apply(const std::unique_ptr& graph) { // initialze fuser params std::vector conv_has_bias_cases{true, false}; - std::vector conv_type_cases{"conv2d", "depthwise_conv2d"}; + std::vector conv_type_cases{"conv2d"}; bool has_int8 = false; bool has_weight_quant = false; for (auto& place : graph->valid_places()) { diff --git a/lite/core/mir/fusion/conv_conv_fuser.cc b/lite/core/mir/fusion/conv_conv_fuser.cc index f2e24d06fa..2393ff5330 100644 --- a/lite/core/mir/fusion/conv_conv_fuser.cc +++ b/lite/core/mir/fusion/conv_conv_fuser.cc @@ -132,8 +132,8 @@ void ConvConvFuser::BuildPattern() { VLOG(5) << "The kernel size of the second conv must be 1x1"; continue; } - if (groups1 != 1) { - VLOG(5) << "The groups of weight1_dim must be 1"; + if (groups0 != 1 || groups1 != 1) { + VLOG(5) << "The all groups of weight_dim must be 1"; continue; } if (ch_out_0 != ch_in_1) { -- GitLab