Hi,


When you use .data (which you should never use in general  ) you break the “link” with tensor1 and tensor2 from the point of view of the autograd. And so what you do there is ignore for gradient computations.
Here you could replace NUM = 42 and you will get the same result.


no because in 1, you do H - NUM but here you do H + NUM. But otherwise yes they will be the same.


There are gradients flowing to H (because you compute it in a differentiable manner) and so this will influence your training.