nn.CrossEntropyLoss has a weight argument, which takes class weights.
If you have an imbalanced dataset, this could help to focus the model on learning the undersampled class.
Note that the per class accuracies of the other classes (majority classes) might suffer from this approach.
What is your class distribution?