The reason is that NLLCriterion expects the input’s last dimension to match num_classes. (http://pytorch.org/docs/0.2.0/nn.html#torch.nn.NLLLoss 8)
To get around this, you can

explicitly write out your loss
cat the Pr[0] with Pr[1], which you derive from Pr[0], together.