Ah ok, I think I misunderstood your question!
As a side note, PyTorch needs the class indices for multi-class classification for the target tensor. You cannot use one-hot encoded targets. The model output will have dimension [batch_size, number_of_classes] though.
In you use case (2 class classification) you can use either of the two approaches.
You could use a linear layer with 2 output units, apply log_softmax on them and use NLLLoss or you could use a linear layer with only 1 output, apply sigmoid on it and use BCELoss.
I’m not sure if one approach is superior to the other, since I see a lot of both methods.
Your ideas was right!