Confusion with nn.CrossEntropyLoss

This example code might be helpful which shows how the target is used to index the logits.

1 Like