Skip to content

Commit 19be595

Browse files
committed
fix bug of KernelDepthwiseConvNHWC
1 parent b47478e commit 19be595

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

paddle/fluid/operators/math/depthwise_conv.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ __device__ __inline__ void KernelDepthwiseConvNHWC(
142142
for (int w_in = w_in_start; w_in < w_in_end; w_in += dilate_width) {
143143
if (h_in >= h_start && h_in < h_end && w_in >= w_start && w_in < w_end) {
144144
int offset = ((batch * input_height + h_in) * input_width + w_in) *
145-
output_channels +
145+
input_channels +
146146
c_in;
147147
T in_data = input_data[offset];
148148
if (fuse_relu_before_conv) {

python/paddle/fluid/tests/unittests/test_conv2d_op.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1235,6 +1235,7 @@ def init_paddings(self):
12351235
create_test_channel_last_class(TestWithPad_AsyPadding)
12361236
create_test_channel_last_class(TestWithGroup_AsyPadding)
12371237
create_test_channel_last_class(TestWith1x1_AsyPadding)
1238+
create_test_channel_last_class(TestWithDepthWise7x7_AsyPadding)
12381239
create_test_channel_last_class(TestWithInput1x1Filter1x1_AsyPadding)
12391240

12401241
create_test_channel_last_class(TestDepthwiseConv_AsyPadding)

0 commit comments

Comments
 (0)