What version of pytorch are you using?
You might be looking at the master version of the docs: http://pytorch.org/docs/master/nn.html?highlight=nllloss#torch.nn.NLLLoss 406. NLLLoss for multiple dimensions was recently added; you’ll have to build from source to use it.