Solved by shivammehta007 in post #2 
              
              
                If you see the documentation for the implementation it has 2 modes in reduction ‘mean’ and ‘sum’ which just specifies the mean and sums of all the (10, 1, 2, 2) values default is mean . 
a = torch.ones(10, 1, 2, 2)
b = torch.randn(10, 1, 2, 2)

torch.binary_cross_entropy_with_logits(a, b)
# shape (1…