Solved by ptrblck in post #2 
              
              
                nn.BCEWithLogitsLoss expects logits which are unbound and have values in [-Inf, +inf] and can be seen as “unnormalized” probabilities (I’m sure @tom or @KFrank can give you a proper mathematical definition), so your output_tensor won’t match the targets perfectly. Since your output contains probabil…