Convolution Backward with unfold and fold

There is an implementation of conv2d forward pass in the unfold documentation page and it works very wellhelp. Could the same be done for a conv2d backward pass using fold and unfold. If so please help me to implement it. I found out the gradients of weight and bias and it matches the pytorch ones but the gradient of the input seems to be not the same. Please help.

1 Like

Any solutions for that?