From c9784eab816c9428eeaa2a283cc33576b365ff9b Mon Sep 17 00:00:00 2001 From: yangfei Date: Wed, 12 Sep 2018 11:09:41 +0800 Subject: [PATCH] repair bug of im2col --- src/operators/math/im2col.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/operators/math/im2col.cpp b/src/operators/math/im2col.cpp index 4065f7d9c4..73e554a395 100644 --- a/src/operators/math/im2col.cpp +++ b/src/operators/math/im2col.cpp @@ -73,9 +73,7 @@ class Im2ColFunctor { const int osize = col_height; const int isize = im_height; bool pad1 = padding[0] > 0; - bool pad2 = - (pad1 && - (((isize - 2 * padding[0] + filter_height) % stride[0] == 0) ? 1 : 0)); + bool pad2 = padding[1] > 0; int fill = isize % 2; if (stride[0] == 1 && filter_height == 3 && pad1 && pad2 && dilation[0] == 1 && im_height > 2) { -- GitLab