From 425edbfb5d546c403189216d6b049ae84529aeb4 Mon Sep 17 00:00:00 2001 From: xiaogang Date: Thu, 9 Jan 2020 09:41:45 +0800 Subject: [PATCH] fix: fix 5x5 choose kernel bug (#2741) (#2744) --- lite/kernels/arm/conv_compute.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lite/kernels/arm/conv_compute.cc b/lite/kernels/arm/conv_compute.cc index 8c76f243a6..52849a026e 100644 --- a/lite/kernels/arm/conv_compute.cc +++ b/lite/kernels/arm/conv_compute.cc @@ -110,8 +110,7 @@ void ConvCompute::PrepareForRun() { bool kps_equal = (pw == ph) && (sh == sw) && (kw == kh); bool no_dilation = (dilations[0] == 1) && (dilations[1] == 1); bool flag_dw_3x3 = (kw == 3 && kh == 3 && (sw == 1 || sw == 2)); - bool flag_dw_5x5 = pads_all_equal && - ((kw == 5 && sw == 1) || (kw == 5 && sw == 2 && pw == 2)); + bool flag_dw_5x5 = pads_all_equal && (kw == 5 && sw == 1); bool flag_dw = flag_dw_3x3 || flag_dw_5x5; if (param.groups == ic && ic == oc && kps_equal && pads_equal && @@ -156,8 +155,7 @@ void ConvCompute::PrepareForRun() { bool kps_equal = (pw == ph) && (sh == sw) && (kw == kh); bool no_dilation = (dilations[0] == 1) && (dilations[1] == 1); bool flag_dw_3x3 = (kw == 3 && kh == 3 && (sw == 1 || sw == 2)); - bool flag_dw_5x5 = pads_all_equal && - ((kw == 5 && sw == 1) || (kw == 5 && sw == 2 && pw == 2)); + bool flag_dw_5x5 = pads_all_equal && (kw == 5 && sw == 1); bool flag_dw = flag_dw_3x3 || flag_dw_5x5; if (param.groups == ic && ic == oc && kps_equal && pads_equal && -- GitLab