torch.size() is method while tensor.shape is attribute torch.tensor() is method while torch.Tensor is class