I am wondering how to deal with incongruent training and test labels with nn.CrossEntropyLoss.
For an ultra minimal example say we have:
logits = torch.tensor([-0.3080, -0.2961]).reshape(1, 2)
y = torch.tensor([0])
y_test = torch.tensor([2])
F.cross_entropy(logits, y)
F.cross_entropy(logits, y_test)  # target is out of bounds

How can I deal with labels found in the test data that never occurred in the training?