albanD:

setattr(model.fc0,‘weight’, w_new )


What I want to avoid is exactly this model.fc0 because I want it to work for a model in general (so I have the string names of the layers)…is that possible?