Solved by ptrblck in post #8 
              
              
                I assume you don’t want to calculate the gradients during evaluation, so you could wrap the evaluation code into a with torch.no_grad(), which would avoid storing the intermediate tensors and would not attach the computation graph to the output tensors. 
Are you using a larger batch size or generall…