Skip to content

Commit 2c14df3

Browse files
authored
Merge pull request #11017 from NHZlX/fix_depthwise_neon_bug
fix neon depthwise conv bug
2 parents 3e177b9 + 75d987a commit 2c14df3

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

paddle/function/neon/NeonDepthwiseConv.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -66,18 +66,18 @@ class NeonDepthwiseConvFunction : public ConvFunctionBase {
6666
float* inputPadding = inputData;
6767
int padInputHeight = inputHeight + 2 * paddingH();
6868
int padInputWidth = inputWidth + 2 * paddingW();
69-
if (paddingH() > 0 || paddingW() > 0) {
70-
int newSize = batchSize * inputChannels * padInputHeight * padInputWidth;
71-
resizeBuffer<Device>(newSize);
72-
inputPadding = reinterpret_cast<float*>(memory_->getBuf());
73-
neon::Padding<float>::run(inputData,
74-
inputPadding,
75-
batchSize * inputChannels,
76-
inputHeight,
77-
inputWidth,
78-
padInputHeight,
79-
padInputWidth);
80-
}
69+
int newSize =
70+
batchSize * (inputChannels + 1) * padInputHeight * padInputWidth;
71+
72+
resizeBuffer<Device>(newSize);
73+
inputPadding = reinterpret_cast<float*>(memory_->getBuf());
74+
neon::Padding<float>::run(inputData,
75+
inputPadding,
76+
batchSize * inputChannels,
77+
inputHeight,
78+
inputWidth,
79+
padInputHeight,
80+
padInputWidth);
8181

8282
std::function<void(
8383
const float*, const float*, int, int, int, int, int, int, float*)>

0 commit comments

Comments
 (0)