ptrblck:

Yes. .clone() is recognized by Autograd and the new tensor will get the grad function as grad_fn=<CloneBackward> .


I never understood this, what is the point of recording .clone() as an operation? It’s extremely unintuitive to me. When I see clone I expect something like deep copy and getting a fresh new version (copy) of the old tensor. Having copying as an operation in a forward pass (like using the identity) but not calling it the identity is extremely confusion.
Am I correct or do I not understand how .clone() works?
I don’t understand what the use case for it is really.