pytorch beginner :torch.data.new() torch.new()
I have a small question, what is the difference between tensor.data.new() and tensor.new()? It seems they all return an empty tensor with the same dtype and device as the self tensor.
Thank you

There is no difference. It's a little convoluted, but, you can think of .data as being essentially the same object as the Tensor that holds it. Every Tensor has a .data, and the .data is, itself, a Tensor, so there's some circular references going on.
The most important part is that they both always point to the same data, so all operations that don't require a gradient on either the tensor or it's .data will give you the same result.
import torch
a = torch.randn((1,2))
a.data.data_ptr() == a.data_ptr()
# True -- indicating it's precisely the same memory/buffer

The .data property is the counter-part to the .grad property. But, for convenience, as most people only care about the data, not the gradients associated with them, there's a default buffer for the Tensor that .data also points to.
