TrainResult erroring with deepcopy on epoch end
When detaching the Result object from the graph the code first calls deepcopy.copy() which throws an error
*** RuntimeError: Can't call numpy() on Tensor that requires grad. Use tensor.detach().numpy() instead.
as the Result object still contains the graphs. It seems like it needs to perform some sort of recursive detach (like the dict implementation in the lines below), since calling detach() on its own will modify training_step_output_for_epoch_end and training_step_output in place.

  
    
      pytorch-lightning/pytorch_lightning/trainer/training_loop.py
    
    
         Line 1038
      in
      f3c63f7
    
  
  
    

        
          
           training_step_output_for_epoch_end = copy(training_step_output) 
        
    
  


N.B. This was run on TPU