Actually, I want to use the hardware to perform this linear computation, and use the result in the CNN. In order to do this, I need to first ensure the linear operations can be replaced properly.
I have checked the document you provided, it seems the conv2d function has the form _add_docstr(torch.conv2d, …), and _add_docstr function is imported from torch._C library. I guess the convolution operation was implemented in C (correct me if I’m wrong). Does it mean I need to modify C code in order to achieve my goal?