Solved by ptrblck in post #4 
              
              
                You could chose between two different approaches: 

treat the binary classification as a multi-class classification with two output units and use nn.CrossEntropyLoss. The target should then contain the class indices ([0, 1] in your case)
use a single output unit and use nn.BCEWithLogitsloss


Sorry …