I’m facing the same problem.
setattr(self, name, newParam) require a nn.Parameter, but once you convert Variable to nn.Parameter, you lost the gradients creating that Variable.
There must be a way that we can bypass this!
Oh yeah! Re-write all nn.Module layers (using register_buffer) would definitely solve to problem.
But Is it worth?