The docs for the loss functions (e.g. nn.CrossEntropyLoss 49) provide the necessary information on how to pass the inputs and targets.
nn.CrossEntropyLoss expects logits, so you shouldn’t apply a softmax on your model outputs.