Size of a tensor (trivial question)

Hello,

Does the tuple of ints size (3,) correspond to a tensor of size 3?
If so, why for example in the
torch.randint(3, 5, (3,))
I cannot call it like
torch.randint(3, 5, 3)?

What exactly does the (3,) represent?

Thanks

It does stand for a tensor of torch.Size([3]).
I think it makes it a bit easier in the backend to always pass tuples in unpacking the dimensions.

1 Like