From 5ba91c38708b5af6e227c0742426b805d39bfafe Mon Sep 17 00:00:00 2001
From: Edmond Yoo <hj3yoo@uwaterloo.ca>
Date: Sat, 15 Sep 2018 00:29:08 +0000
Subject: [PATCH] temp

---
 src/col2im.c |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/src/col2im.c b/src/col2im.c
index 0fb3db4..5c4605e 100644
--- a/src/col2im.c
+++ b/src/col2im.c
@@ -1,6 +1,6 @@
 #include <stdio.h>
 #include <math.h>
-inline void col2im_add_pixel(float *im, int height, int width, int channels,
+void col2im_add_pixel(float *im, int height, int width, int channels,
                         int row, int col, int channel, int pad, float val)
 {
     row -= pad;
@@ -16,13 +16,9 @@
          int ksize,  int stride, int pad, float* data_im) 
 {
     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