Hi,
I found this this code to zero the gradients on single parameter:
a.grad.zero_()
But it is not working: AttributeError: 'NoneType' object has no attribute 'zero_'
I previously declared:
a = torch.tensor(-1., requires_grad=True)
a = nn.Parameter(a)