Hi,
You should use clone() to get a new Tensor with the same value but that is backed by new memory.
The tutorial uses it because it later modifies the Tensor inplace and it is forbidden to modify the gradient given to you inplace. So it first clone it to get new memory. Then the inplace change won’t break that rule.