From the docs 31 for NLLLoss2d:

This loss does not support per-class weights

However, the Parameters include:

weight (Tensor, optional) a manual rescaling weight given to each class.

So is weight supported or not? Should the docs be changed?