Reimplementing conv2d as a c++ extension

Hi, i’m trying to (re)implement 2d convolution manually, as i need to change some details in how it works due to implementing a low-level convolution approximation algorithm (also described in a bit more detail here

My general idea is to take the pytorch cpp files and simply adjust the needed values; However, when taking the ConvolutionMM2d.cpp, and registering it as an extension (in the same way as the LLTM tutorial extension), the cpp file does not compile. Obviously i am missing something, as i am inexperienced in the ways of cpp and pytorch, but i would think that taking an (obviously working) part of a library would work and be a good starting point for adjustments.

Does anyone know how i could progress with this?