Solved by ptrblck in post #2 
              
              
                Your example output seems to be a binary classification output, so you could use nn.BCELoss after applying sigmoid on your output. 
However, to get more numerical stability I would recommend to let the model return raw logits and use nn.BCEWithLogits instead. This will also give you the ability to s…