This post gives you a quick overview for the different approaches for a binary classification use case.
Basically you can treat it as a “real” binary classification with a single output unit (and nn.BCEWithLogitsLoss) or as a mutli-class classification using 2 classes (and nn.CrossEntropyLoss).
For the first use case, pass the raw logits to nn.BCEWithLogitsLoss for more numerical stability compared to sigmoid + nn.BCELoss.