Solved by albanD in post #3 
              
              
                would it be dangerous or lead to unintended consequences to use .data here? 

Another major difference between .data and .detach() that you don’t mention here is inplace correctness. 
Basically, when we save Tensors because their value is needed to compute the gradients, we have special logic that …