This might be it, two questions:

I need to compute the loss on the first dim, as this dimension contains the probability maps after reshaping ,NLLLoss does not give me an option to compute the loss on a specific dim against the target.
How do I test the loss function against toy inputs? I need to be sure that its exactly what I need.