From 0e320271d4643c166368c2294de639389b705bc6 Mon Sep 17 00:00:00 2001 From: zhangxuetong Date: Tue, 4 Aug 2020 19:09:39 +0800 Subject: [PATCH] fix avgpool bug --- mindspore/lite/src/gllo/fusion/conv_biasadd_fusion.cc | 2 +- mindspore/lite/src/runtime/kernel/arm/base/concat_base.cc | 2 +- mindspore/lite/src/runtime/kernel/arm/opclib/fp32/pooling.cc | 5 +---- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/mindspore/lite/src/gllo/fusion/conv_biasadd_fusion.cc b/mindspore/lite/src/gllo/fusion/conv_biasadd_fusion.cc index d6ad80382..234c23b34 100644 --- a/mindspore/lite/src/gllo/fusion/conv_biasadd_fusion.cc +++ b/mindspore/lite/src/gllo/fusion/conv_biasadd_fusion.cc @@ -144,7 +144,7 @@ const AnfNodePtr ConvBiasaddFusion::Process(const FuncGraphPtr &func_graph, cons MS_ASSERT(primitiveT_value); auto type = primitiveT_value->GetPrimitiveT()->value.type; if (type == schema::PrimitiveType_Conv2D) { - primitiveT_value->GetPrimitiveT()->value.AsConv2D()->hasBias = true;; + primitiveT_value->GetPrimitiveT()->value.AsConv2D()->hasBias = true; } else if (type == schema::PrimitiveType_DepthwiseConv2D) { primitiveT_value->GetPrimitiveT()->value.AsDepthwiseConv2D()->hasBias = true; } else if (type == schema::PrimitiveType_DeConv2D) { diff --git a/mindspore/lite/src/runtime/kernel/arm/base/concat_base.cc b/mindspore/lite/src/runtime/kernel/arm/base/concat_base.cc index 15a7b417c..152647aa7 100644 --- a/mindspore/lite/src/runtime/kernel/arm/base/concat_base.cc +++ b/mindspore/lite/src/runtime/kernel/arm/base/concat_base.cc @@ -85,7 +85,7 @@ kernel::LiteKernel *CpuConcatInt32KernelCreator(const std::vector &inputs, const std::vector &outputs, OpParameter *opParameter, const Context *ctx, - const kernel::KernelKey &desc) {; + const kernel::KernelKey &desc) { if (opParameter == nullptr) { MS_LOG(ERROR) << "Input opParameter is nullptr!"; return nullptr; diff --git a/mindspore/lite/src/runtime/kernel/arm/opclib/fp32/pooling.cc b/mindspore/lite/src/runtime/kernel/arm/opclib/fp32/pooling.cc index f2d3c11d0..cf84fb131 100644 --- a/mindspore/lite/src/runtime/kernel/arm/opclib/fp32/pooling.cc +++ b/mindspore/lite/src/runtime/kernel/arm/opclib/fp32/pooling.cc @@ -81,9 +81,7 @@ void AvgPooling(const float *input_ptr, float *output_ptr, PoolingParameter *poo } // win_w loop } // win_h loop #ifdef ENABLE_NEON - float reverse_count = 1 / real_count; - float32x4_t dup_count = vdupq_n_f32(reverse_count); - vst1q_f32(output_ptr + out_channel_offset, vmulq_f32(tmp_avg, dup_count)); + vst1q_f32(output_ptr + out_channel_offset, tmp_avg / vdupq_n_f32(real_count)); #else *(output_ptr + out_channel_offset) = tmp_avg1 / (float)real_count; *(output_ptr + out_channel_offset + 1) = tmp_avg2 / (float)real_count; @@ -208,4 +206,3 @@ void MaxPooling(const float *input_ptr, float *output_ptr, PoolingParameter *poo } // out_plane loop } // out_batch loop } - -- GitLab