How to add an ignore_label in loss layers?
Chenqi_Qi
For example: <SCODE>import torch
import torch.nn as nn

nClasses = 10
ignore_classes = torch.LongTensor([4, 7]) # ignore class 5 and 8
weights = torch.ones(nClasses)
weights[ignore_classes] = 0.0
loss = nn.NLLLoss2d(weights)
<ECODE>
smth