Difference between Tensor and tensor
I am working with Pytorch. But when I use tensor I got an error while I don't get any error when I use Tensor.
What is the difference between Tensor and tensor?
This is my example:
tns = torch.tensor([91,21,34,56])

tns.mean()

I got this error:

RuntimeError: Can only calculate the mean of floating types. Got Long
instead.

Thanks in advance.

If you don't specify a dtype in torch.tensor() it infers this from the data. Since your data is all integers, it used Long.
torch.mean() can only be calculated for floats.
By default, torch.Tensor is an alias for torch.FloatTensor hence it automatically has dtype float (unless you change the default behaviour).
