PyTorch: difference between type(a), a.type, a.type()
suppose a is a tensor, then what's the difference between:
type(a)
a.type
a.type()
I couldn't find a document differentiating these.

type is the python in-built method.

It will return type of object. like &lt;class 'torch.Tensor'&gt;

torch.Tensor.type (x.type()) is pytorch in-built method.

It will return type of data stored inside tensor. like torch.DoubleTensor, etc.


Edit:
And about x.type() vs x.type -
When you write a function name with parentheses x.type () it will actually execute the function and return its value. Whereas without parentheses x.type it is simply a reference to function.
