The following code outputs:
4, 0.4, 4
instead of
4, 0.4, 0.04
and there seem to be errors for other loss functions as well, like SmoothL1Loss.
loss = nn.L1Loss()
y = Variable(torch.FloatTensor(1).fill_(0))
print(loss.forward(Variable(torch.FloatTensor(1).fill_(4.)), y))
print(loss.forward(Variable(torch.FloatTensor(1).fill_(.4)), y))
print(loss.forward(Variable(torch.FloatTensor(1).fill_(.04)), y))