Per-Class weights in nn.NLLLoss2d

From the docs 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?

It’s a typo, it does support weights. I’ve fixed the documentation (it will regenerate shortly).

1 Like