localh:

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



Ah I see – the question seems silly now. I should have just made a tweak and played around a bit more. Thank you for your time and help!