What does torch.Size([0]) means?

i understand tensor shape torch.Size([1]) and scalar shape torch.Size([]), but
what does torch.Size([0]) means generated by torch.randn(0), is it a bug??

In [4]: a=torch.randn(0)

In [5]: a
Out[5]: tensor([])

In [8]: a.shape
Out[8]: torch.Size([0])

In [9]: a=torch.tensor(0)

In [10]: a.shape
Out[10]: torch.Size([])

In [11]: a=torch.tensor([0.0])

In [12]: a.shape
Out[12]: torch.Size([1])

1 Like

A tensor of this size is 1-dimensional but has no elements.

Contrast this to a tensor of size torch.Size([1]), which means it is 1 dimensional and has one element.