Hi
I need to modify the parameters of a model, I am doing this
  delattr(base, localname)
  setattr(base, localname, param)

but when I update a parameter with setattr, this is already deleted from the state_dict, and I require to keep the value in the state_dict as well when I do setattr, so if I print
print("length of state_dict ", len(module.state_dict().keys()))

after the first operation this is 1 less, which I want this to be the same length after the second line, thanks a lot for your help
More context of what I am doing: I need to define all parameters of the model based on 1 parameter, I therefore define a parameter, then freeze all parameters and need to train only that one parameter, and compute and substitute all the rest of the parameters based on it.
@ptrblck you are my hope.