Extension of convolution layer using CFFI
It seems that I can start from some sources from pytorch/torch/lib/… Could I just know what sources I have to use or a big picture of getting started?
Ja-Keoung_Koo
What additional information would get you started?
smth
apaszke
Thanks for your information. In /THNN/docs I found a description of module = nn.SpatialConvolution(nInputPlane, nOutputPlane, kW, kH, [dW], [dH], [padW], [padH]) But it seems that there is no SpatialConvolution in THNN/generic. I am just curious:
Ja-Keoung_Koo
smth
<SCODE>THNN_(col2im)(
  THTensor_(data)(gradColumns),
  nInputPlane, inputHeight, inputWidth, outputHeight, outputWidth,
  kH, kW, padH, padW, dH, dW,
  dilationH, dilationW,
  THTensor_(data)(gradInput_n)
);
<ECODE>
Zijun_Wei
Hi, Best regards Thomas
tom
Zijun_Wei
tom
THNN_Floatim2col(THFloatTensor_data(input_h_w), 1, inputHeight, inputWidth, kH, kW, padH, padW, dH, dW, dilationH, dilationW, THFloatTensor_data(columns)); But when I compile the file, the warning comes out: <SCODE>warning: implicit declaration of function 'THNN_Float_im2col' is invalid in C99 [-Wimplicit-function-declaration]
            THNN_Float_im2col(THFloatTensor_data(input_h_w), 1, inputHeight, inputWidth, kH, kW, padH, padW, dH, dW, dilationH, dilationW, THFloatTensor_data(columns))
<ECODE> I wonder this might because I need to declare it first. So the question is,  what is the full declaration for THNN_Float_im2col? I’m new to c, so if I understand this wrong or there is an other way to solve this problem, please let me know. Many thanks.
Zijun_Wei
I think the declaration is more <SCODE>static void THNN_Floatim2col(const float* data_im, const int channels,
      const int height, const int width, const int kernel_h, const int kernel_w,
      const int pad_h, const int pad_w,
      const int stride_h, const int stride_w,
      const int dilation_h, const int dilation_w,
      float* data_col);
<ECODE> or so (by literally copying the declaration in the file and substituting). From the message, you seem to have an extra underscore somewhere. Best regards Thomas
tom
Where did you copy this?
Zijun_Wei
Hi! Best regards Thomas
tom
THNN_Floatim2col' has internal linkage but is not defined If I removed the declaration I got: implicit declaration of function 'THNN_Floatim2col' is invalid in C99 I will continue to check if it is possible to get the header files that defines THNN_Floatim2col.
Zijun_Wei
Zijun_Wei
111128
mhubii