Skip to content

Commit fbd8a33

Browse files
committed
regenerate the proto for support the dilation
1 parent 469b3ad commit fbd8a33

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

paddle/function/ConvOpTest.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,13 @@ void Convolution(const std::string& conv1,
8181
for (size_t padding : {0, 1}) {
8282
for (size_t dilation : {1, 3}) {
8383
if (padding >= filterSize) break;
84+
size_t filterS = (filterSize - 1) * dilation + 1;
8485

85-
if ((conv1 == "NaiveConv-CPU" || conv2 == "NaiveConv-CPU") &&
86+
if (inputSize + 2 * padding < filterS) break;
87+
88+
if ((conv1 == "NaiveConv-CPU" || conv2 == "NaiveConv-CPU" ||
89+
conv1 == "NNPACKConv-CPU" ||
90+
conv2 == "NNPACKConv-CPU") &&
8691
dilation > 1)
8792
break;
8893

@@ -93,7 +98,7 @@ void Convolution(const std::string& conv1,
9398
break;
9499

95100
size_t outputSize =
96-
(inputSize - filterSize + 2 * padding + stride) / stride;
101+
(inputSize - filterS + 2 * padding + stride) / stride;
97102
VLOG(3) << " batchSize=" << batchSize
98103
<< " inputChannels=" << inputChannels
99104
<< " inputHeight=" << inputSize

paddle/function/Im2ColTest.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ void TestIm2ColFunctor() {
3232
for (size_t dilation : {1, 3}) {
3333
size_t filterSizeH = (filterHeight - 1) * dilation + 1;
3434
size_t filterSizeW = (filterWidth - 1) * dilation + 1;
35-
if (inputHeight <= filterSizeH || inputWidth <= filterSizeW)
35+
if (inputHeight + 2 * padding < filterSizeH ||
36+
inputWidth + 2 * padding < filterSizeW)
3637
break;
3738
if (padding >= filterSizeH || padding >= filterSizeW) break;
3839
size_t outputHeight =

python/paddle/trainer_config_helpers/tests/configs/protostr/test_roi_pool_layer.protostr

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ layers {
3636
stride_y: 1
3737
output_y: 14
3838
img_size_y: 14
39+
dilation: 1
40+
dilation_y: 1
3941
}
4042
}
4143
bias_parameter_name: "___conv_0__.wbias"

0 commit comments

Comments
 (0)