Convert Conv2d to Linear

Hello
saying that I have a conv2d layer, I know that its a special case of a Linear layer, how can I convert a Conv2d Layer to Linear?
for example :

Conv2d(96, 1000, kernel_size=torch.Size([10, 10]), stride=(1, 1))

You could unfold the input to apply the im2col transformation and reshape the kernels to the kernel matrix as explained in this blog post by Pete Warden.

1 Like