Skip to content

Commit

Permalink
regenerate the proto for support the dilation
Browse files Browse the repository at this point in the history
  • Loading branch information
NHZlX committed Nov 14, 2017
1 parent 469b3ad commit fbd8a33
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
9 changes: 7 additions & 2 deletions paddle/function/ConvOpTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,13 @@ void Convolution(const std::string& conv1,
for (size_t padding : {0, 1}) {
for (size_t dilation : {1, 3}) {
if (padding >= filterSize) break;
size_t filterS = (filterSize - 1) * dilation + 1;

if ((conv1 == "NaiveConv-CPU" || conv2 == "NaiveConv-CPU") &&
if (inputSize + 2 * padding < filterS) break;

if ((conv1 == "NaiveConv-CPU" || conv2 == "NaiveConv-CPU" ||
conv1 == "NNPACKConv-CPU" ||
conv2 == "NNPACKConv-CPU") &&
dilation > 1)
break;

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

size_t outputSize =
(inputSize - filterSize + 2 * padding + stride) / stride;
(inputSize - filterS + 2 * padding + stride) / stride;
VLOG(3) << " batchSize=" << batchSize
<< " inputChannels=" << inputChannels
<< " inputHeight=" << inputSize
Expand Down
3 changes: 2 additions & 1 deletion paddle/function/Im2ColTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ void TestIm2ColFunctor() {
for (size_t dilation : {1, 3}) {
size_t filterSizeH = (filterHeight - 1) * dilation + 1;
size_t filterSizeW = (filterWidth - 1) * dilation + 1;
if (inputHeight <= filterSizeH || inputWidth <= filterSizeW)
if (inputHeight + 2 * padding < filterSizeH ||
inputWidth + 2 * padding < filterSizeW)
break;
if (padding >= filterSizeH || padding >= filterSizeW) break;
size_t outputHeight =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ layers {
stride_y: 1
output_y: 14
img_size_y: 14
dilation: 1
dilation_y: 1
}
}
bias_parameter_name: "___conv_0__.wbias"
Expand Down

0 comments on commit fbd8a33

Please sign in to comment.