提交 fbd8a330 编写于 作者: X xzl

regenerate the proto for support the dilation

上级 469b3ad5
...@@ -81,8 +81,13 @@ void Convolution(const std::string& conv1, ...@@ -81,8 +81,13 @@ void Convolution(const std::string& conv1,
for (size_t padding : {0, 1}) { for (size_t padding : {0, 1}) {
for (size_t dilation : {1, 3}) { for (size_t dilation : {1, 3}) {
if (padding >= filterSize) break; 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) dilation > 1)
break; break;
...@@ -93,7 +98,7 @@ void Convolution(const std::string& conv1, ...@@ -93,7 +98,7 @@ void Convolution(const std::string& conv1,
break; break;
size_t outputSize = size_t outputSize =
(inputSize - filterSize + 2 * padding + stride) / stride; (inputSize - filterS + 2 * padding + stride) / stride;
VLOG(3) << " batchSize=" << batchSize VLOG(3) << " batchSize=" << batchSize
<< " inputChannels=" << inputChannels << " inputChannels=" << inputChannels
<< " inputHeight=" << inputSize << " inputHeight=" << inputSize
......
...@@ -32,7 +32,8 @@ void TestIm2ColFunctor() { ...@@ -32,7 +32,8 @@ void TestIm2ColFunctor() {
for (size_t dilation : {1, 3}) { for (size_t dilation : {1, 3}) {
size_t filterSizeH = (filterHeight - 1) * dilation + 1; size_t filterSizeH = (filterHeight - 1) * dilation + 1;
size_t filterSizeW = (filterWidth - 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; break;
if (padding >= filterSizeH || padding >= filterSizeW) break; if (padding >= filterSizeH || padding >= filterSizeW) break;
size_t outputHeight = size_t outputHeight =
......
...@@ -36,6 +36,8 @@ layers { ...@@ -36,6 +36,8 @@ layers {
stride_y: 1 stride_y: 1
output_y: 14 output_y: 14
img_size_y: 14 img_size_y: 14
dilation: 1
dilation_y: 1
} }
} }
bias_parameter_name: "___conv_0__.wbias" bias_parameter_name: "___conv_0__.wbias"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册