I tried the expand example on the documentation and got this:



x = torch.Tensor([[1],[2],[3]])
x.expand(-1,4)



Traceback (most recent call last):
File “<pyshell#58>”, line 1, in 
x.expand(-1,4)
RuntimeError: The expanded size of the tensor (-1) must match the existing size (3) at non-singleton dimension 0. at /Users/soumith/code/builder/wheel/pytorch-src/torch/lib/TH/generic/THTensor.c:308