提交 0e320271 编写于 作者: Z zhangxuetong

fix avgpool bug

上级 8a0b3e23
......@@ -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) {
......
......@@ -85,7 +85,7 @@ kernel::LiteKernel *CpuConcatInt32KernelCreator(const std::vector<lite::tensor::
kernel::LiteKernel *CpuConcatFp32KernelCreator(const std::vector<lite::tensor::Tensor *> &inputs,
const std::vector<lite::tensor::Tensor *> &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;
......
......@@ -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
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册