Add dilation.

del_some_in_makelist
hedaoyuan 8 years ago
parent 19547943ba
commit a850dec991

@ -233,6 +233,8 @@ public:
strideW(),
paddingH(),
paddingW(),
dilationH(),
dilationW(),
colHeightStart,
K,
colWidthStart,

@ -109,6 +109,8 @@ public:
int strideWidth,
int paddingHeight,
int paddingWidth,
int dilationHeight,
int dilationWidth,
int colHeightStart,
int colHeightSize,
int colWidthStart,
@ -128,8 +130,8 @@ public:
int h = (colWidthStart + colw) / outputWidth;
int w = (colWidthStart + colw) % outputWidth;
int imRowIdx = h * strideHeight + hOffset;
int imColIdx = w * strideWidth + wOffset;
int imRowIdx = h * strideHeight + hOffset * dilationHeight;
int imColIdx = w * strideWidth + wOffset * dilationWidth;
if ((imRowIdx - paddingHeight) < 0 ||
(imRowIdx - paddingHeight) >= inputHeight ||
(imColIdx - paddingWidth) < 0 ||

@ -147,7 +147,7 @@ void TestIm2ColMobileFunctor() {
for (size_t filterWidth : {3, 7}) {
for (size_t stride : {1, 2}) {
for (size_t padding : {0, 1}) {
for (size_t dilation : {1 /*, 3*/}) {
for (size_t dilation : {1, 3}) {
size_t filterSizeH = (filterHeight - 1) * dilation + 1;
size_t filterSizeW = (filterWidth - 1) * dilation + 1;
if (inputHeight + 2 * padding < filterSizeH ||
@ -200,6 +200,8 @@ void TestIm2ColMobileFunctor() {
stride,
padding,
padding,
dilation,
dilation,
0,
height,
0,

Loading…
Cancel
Save