Hi, I also have the same issue with nn.functional.conv2d and nn.functional.conv_transpose2d. I use nn.Parameter type for variables but still get None gradient. Do you have any solution to it? Thanks! (I am using the newest version of Pytorch 0.3)
Here is my code:
filters = nn.Parameter(torch.randn(8,4,3,3),required_grad=True)
inputs = nn.Parameter(torch.randn(1,4,5,5),requires_grad=True)
tmp = F.conv2d(inputs, filters, padding=1).sum()
tmp.backward()
tmp.grad
Then I got nothing for tmp.grad