Expand with negative shape

hi, all:
I found torch.expand function can work with negative shape, such as [-1, 32, -1, -4], that’s weird!
any one give some tips?

In [73]: b.shape
Out[73]: torch.Size([1, 32, 1, 1])

In [72]: b.expand(-1,32,-1,-1).shape
Out[72]: torch.Size([1, 32, 1, 1])


In [71]: b.expand(-1,32,-1,-4).shape
Out[71]: torch.Size([1, 32, 1, -4])

passing -1 as size has a specific meaning and it’s documented: https://pytorch.org/docs/stable/tensors.html#torch.Tensor.expand

@smth, thanks.
However, my question, why passing -4 do not trigger Error?