For simplicity, in pytorch, if a Variable contains a single value, var.backward() is equivalent to var.backward(torch.Tensor([1])).
If you use the loss without reduction (to be able to use the value for each sample in your batch independently?), you get as output a Variable which contains one entry per sample in your batch. So you should provide a gradient for each of them.
All the following are equivalent
# With reduce=True
# loss.size() == [1]
loss.backward()
loss.backward(torch.Tensor([1]))
loss.backward(torch.ones_like(loss.data))

# With reduce=False
# loss.size() == [batch_size, 1] or [batch_size]
loss.sum().backward()
loss.backward(torch.ones_like(loss.data))