Solved by albanD in post #2 
              
              
                Hi, 
What happens is that you seem to run this code with the autograd enabled. 
Since the parameters in the resnet require gradients, your out does as well (and so contains all the history to compute these gradients if needed). When you save out.cpu() in your dictionary, you still hold onto this his…