As I wrote it‘s an exercise and we have to do some second order optimization of the learning rate by doing a backtracking using the loss function (Armijo condition, line search). While backtracking the loss has to be computed from different weights, so the network itself changes, therefore the state_dict is saved and the original weights are reloaded again (that‘s my interpretation, I‘m not sure as I‘m not the author of the code).
Is it in some way possible to disable PyTorch‘s checks for integrity? I know this doesn‘t make sense usually, but in this case it would be easier, I mean.
Or is there a PyTorch version that does no checks? I think there must be one, other than that this exercise would never be executable? Or I misunderstood something in the code, which might even be possible to some degree.
I can‘t provide more code as there‘s a strict copyright on it, and I do not want to run into legal issues.