Using im2col in c extensions

I’m trying to implement some customized Convolution and I need the im2col function
I checked the implementation in SpatialDilatedConvolution.c and the im2col is written as:

THNN_(col2im)(
  THTensor_(data)(gradColumns),
  nInputPlane, inputHeight, inputWidth, outputHeight, outputWidth,
  kH, kW, padH, padW, dH, dW,
  dilationH, dilationW,
  THTensor_(data)(gradInput_n)
);

Since I’m just using Float type, so I tried THNN_Floatim2col, but it does not work

My questions are:

  1. How can I call im2col in c extensions with Float type (in GPU and CPU version)?

  2. Do I need to include any head files?

1 Like