Didn’t BCELosswithLogits() do the purpose then ?
If you were using this bce-with-logits, then torch.sigmoid() is the right way as you have posted in the question.
If you’ve used nn.CrossEntropyLoss(), then u apply Softmax(), and pick the class which has the highest value.
In your case, picking the class with highest value would always result in the same class ( zeroth class ), since you have just one neuron.