Turns out my solution was not general enough. It only works for parameters that are directly created in the init function as nn.Parameter, but not for parameters that belong to a Module such as nn.Linear. Those aren’t in net._parameters. I can’t think of a gereral solution that isn’t very cumbersome. Any more tips?