Solved by albanD in post #6 
              
              
                I am afraid BCELoss does not. 
But looking at the code, BCELossWithLogits does (https://pytorch.org/docs/stable/generated/torch.nn.BCEWithLogitsLoss.html?highlight=bce#torch.nn.BCEWithLogitsLoss) 
So if you actually use a sigmoid before it and want to merge both, that will work  
Otherwise, you will…