I had the same problem and I think it might also be productive for others. Although I set “requires_grad” equal to True, the model didn’t change the parameter value. I used all functions from Pytorch.
I used torch.nn.Parameter and the model consider it this time among parameters that should be passed through the optimizer.
So, I think using torch.nn.Parameter is necessary.
Thanks for your informative answer