I also see this error in 0.3.0.post4.
I calculated loss like below
loss = torch.mean(torch.stack(losses, 0), 0)
print (loss)
loss.backward() # -- error

Variable containing:
 0.2055
 [torch.cuda.FloatTensor of size 1 (GPU 0)]

Traceback (most recent call last):
File "train.py", line 160, in <module>
train(model, train_data, optimizer)
File "train.py", line 121, in train
loss.backward()
File "/home/jef/anaconda3/lib/python3.6/site-packages/torch/autograd/variable.py", line 167, in backward
torch.autograd.backward(self, gradient, retain_graph, create_graph, retain_variables)
File "/home/jef/anaconda3/lib/python3.6/site-packages/torch/autograd/__init__.py", line 99, in backward
variables, grad_variables, retain_graph)
RuntimeError: invalid argument 1: the number of sizes provided must be greater or equal to the number of dimensions in the tensor at /pytorch/torch/lib/THC/generic/THCTensor.c:309