.data should not be used anymore as it has weird semantic.
And rewrapping into an nn.Parameter has the side effect of calling .detach(), meaning that you would get a brand new set of parameters that are not necessarily the same as the ones you passed the optimizer.