Solved by ptrblck in post #2 
              
              
                Both approaches are the same. 
In fact nn.CrossEntropyLoss just uses nn.LogSoftmax() + nn.NLLLoss() internally. 
Here is the line of code. 
For a binary classification you could use nn.CrossEntropyLoss() with a logit output of shape [batch_size, 2] or nn.BCELoss() with a nn.Sigmoid() in the last lay…