Solved by KFrank in post #2 
              
              
                Hi Anshul! 

You should use binary_cross_entropy_with_logits() with no 
“reduction.”  Thus: 
torch.nn.functional.binary_cross_entropy_with_logits (prediction, loss_labels, reduction = 'none')

This will return a tensor of loss values of shape [batch_size, 104] 
(neither summed, nor averaged, nor oth…