Custom conv op in conv2d

Hi, Is there any way to re-write the convolution operation in nn.conv2d? My goal is to create a module myconv2d. It basically inherent everything(including backward) in conv2d but with a rewrite convolution in C++/CUDA.
I found this to be useful but I dont know how to only replace the conv op with my version, instead of rewrite the whole conv2d.

Using a custom extension sounds like the right approach and you could try to reuse the native conv implementation from here.