Do the dicts contain CUDATensors or CPUTensors?
In the former case, you should detach them, if you don’t want to use them for the gradient calculation anymore, as they might store the whole computation graph otherwise.
Also, check your code for any storage of CUDATensors, which would be used for printing/logging purposes and are not detached.