you can use label -1 index no label,
set criterion = nn.CrossEntropyLoss(ignore_index=-1, reduction=“mean”)
I want to know, for multi-task, the label is a label list, so  how to create your Dataset, Could you please show me your defined Dataset? Thank you very much~