From 9f3eb91d8ffec9a982da8f0cb1760e8685a51e7b Mon Sep 17 00:00:00 2001 From: zlx Date: Wed, 30 May 2018 00:34:22 +0800 Subject: [PATCH] fix neon depthwise conv bug --- paddle/function/neon/NeonDepthwiseConv.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/paddle/function/neon/NeonDepthwiseConv.cpp b/paddle/function/neon/NeonDepthwiseConv.cpp index 85bc95bb8..199e23c4c 100644 --- a/paddle/function/neon/NeonDepthwiseConv.cpp +++ b/paddle/function/neon/NeonDepthwiseConv.cpp @@ -66,18 +66,16 @@ class NeonDepthwiseConvFunction : public ConvFunctionBase { float* inputPadding = inputData; int padInputHeight = inputHeight + 2 * paddingH(); int padInputWidth = inputWidth + 2 * paddingW(); - if (paddingH() > 0 || paddingW() > 0) { - int newSize = batchSize * inputChannels * padInputHeight * padInputWidth; - resizeBuffer(newSize); - inputPadding = reinterpret_cast(memory_->getBuf()); - neon::Padding::run(inputData, + int newSize = batchSize * (inputChannels + 1) * padInputHeight * padInputWidth; + resizeBuffer(newSize); + inputPadding = reinterpret_cast(memory_->getBuf()); + neon::Padding::run(inputData, inputPadding, batchSize * inputChannels, inputHeight, inputWidth, padInputHeight, padInputWidth); - } std::function -- GitLab