Solved by albanD in post #2 
              
              
                Hi, 
You should recompute the value in the forward but without trying to override the original Parameter: 
class RandomClass(torch.nn.module):
     def __init__():
          ...
          self._weights = torch.nn.Parameter(0.5*torch.ones(2), requires_grad=True)
          ...

     def forward():
   …