I write the following code:
a = torch.rand(3, 5)
type(a)                      #  torch.Tensor
type(a.data)              #  torch.Tensor
id(a)                          #  4493764504
id(a.data)                 #  4493475488

I don’t understand the difference between Tensor a and Tensor a.data, and when to use a and when to use a.data.
Thanks.