spanev:

For Tensor s in most cases, you should go for clone since this is a PyTorch operation that will be recorded by autograd.


I never understood this. Why would one ever want to have clone be in the computation graph? It’s just the identity!
When I make a copy of something I usually expect a brand new object, with new memory allocation and new instance of the object class it belongs. Not just copying pointers/references around. Can you clarify?