From 8f1b4e0962857d402f9d017fcbf387ef0eceb7c4 Mon Sep 17 00:00:00 2001
From: Joseph Redmon <pjreddie@gmail.com>
Date: Thu, 01 Sep 2016 23:48:41 +0000
Subject: [PATCH] updates and things

---
 src/im2col.c |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/src/im2col.c b/src/im2col.c
index 1ff45c8..69ec98a 100644
--- a/src/im2col.c
+++ b/src/im2col.c
@@ -18,13 +18,9 @@
      int ksize,  int stride, int pad, float* data_col) 
 {
     int c,h,w;
-    int height_col = (height - ksize) / stride + 1;
-    int width_col = (width - ksize) / stride + 1;
-    if (pad){
-        height_col = 1 + (height-1) / stride;
-        width_col = 1 + (width-1) / stride;
-        pad = ksize/2;
-    }
+    int height_col = (height + 2*pad - ksize) / stride + 1;
+    int width_col = (width + 2*pad - ksize) / stride + 1;
+
     int channels_col = channels * ksize * ksize;
     for (c = 0; c < channels_col; ++c) {
         int w_offset = c % ksize;

--
Gitblit v1.10.0