Hi,
The loading of the state dict is not tracked as a differentiable op by the autograd.
But it does modify the existing parameters inplace with the new value. But these values are required to compute the backward pass (as they were used during the forward) and thus the error you see.
Why do you need to do this? Can you give a bit more context on what you’re trying to achieve here?