Why is sourceTensor.clone() not a leaf variable?

I noticed recently that sourceTensor.clone() is not a leaf variable and is part of the original computational graph and I wondered why this could be useful?

To allow in-place operations for example.

This for instance. Instead of adding 0., one can use *.clone() as in here.

1 Like

Okay, thank you!
Best regards,
Stefan