From 37de77554c3e30131f6e30148874caee6a4af021 Mon Sep 17 00:00:00 2001 From: zhaojiaying01 Date: Wed, 29 Aug 2018 16:18:13 +0800 Subject: [PATCH] fix im2col in case of 2*2 input --- src/operators/math/im2col.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/operators/math/im2col.cpp b/src/operators/math/im2col.cpp index 7b0b974b54..cb4d02f45c 100644 --- a/src/operators/math/im2col.cpp +++ b/src/operators/math/im2col.cpp @@ -78,7 +78,7 @@ class Im2ColFunctor { (((isize - 2 * padding[0] + filter_height) % stride[0] == 0) ? 1 : 0)); int fill = isize % 2; if (stride[0] == 1 && filter_height == 3 && pad1 && pad2 && - dilation[0] == 1) { + dilation[0] == 1 && im_height > 2) { for (int c = 0; c < im_channels; ++c) { int oosize = osize * osize; int nk4 = osize / 4; @@ -250,7 +250,7 @@ class Im2ColFunctor { im_data += isize * isize; } } else if (stride[0] == 2 && filter_height == 3 && pad1 && - dilation[0] == 1) { + dilation[0] == 1 && im_height > 2) { for (int c = 0; c < im_channels; ++c) { int oosize = osize * osize; int nk4 = osize / 4; -- GitLab