I am running a simple network calculating L1 loss for debugging.  I’m tracking everything and numbers do not seem to line up.
network output:

(Pdb) output
Variable containing:
0.4068  0.4739
[torch.cuda.FloatTensor of size 1x2 (GPU 0)]

Target output:

(Pdb) targets
Variable containing:
0
1
[torch.cuda.LongTensor of size 2 (GPU 0)]

But then from a register_backward_hook on my output layer I am getting

Variable containing:
(0 ,0 ,.,.) =
0.5000
(0 ,1 ,.,.) =
-0.5000
[torch.cuda.FloatTensor of size 1x2x1x1 (GPU 0)]