David_Bau:

type(new Tensor(5))


That’s not expected behavior I believe. Here is what I receive:
>>> type(torch.Tensor(5))
<class 'torch.FloatTensor'>


To summarize this thread:

To print tensor type use: print(type(tensor))

To print variable tensor type use: print(type(tensor.data))