Manipulating an nn.Parameter creates a non-leaf tensor as seen here:
T = nn.Parameter(torch.randn(1))
print(T.is_leaf)
> True
T = T - T
print(T.is_leaf)
> False

so you would either have to manipulate it inplace (e.g. via T.copy_()) or create a new nn.Parameter() (but make sure to add it to the optimizer afterwards, if necessary).