Solved by ptrblck in post #2 
              
              
                nn.CrossEntropyLoss is used for a multi-class classification, while your model outputs the logits for a single class. 
If you are dealing with a binary classification, you could use nn.BCEWithLogitsLoss, or output two logits and keep nn.CrossEntropyLoss.