Access and overwrite ALL the weights (automatically, in a loop)

Ok thank you very much, yes this immediately works. I had found this other solution first Overwrite parameters of model with new values but it’s nice you can avoid using state_dict().