The equality even fails after a reshape
    valid = torch.ones(real_batch.size(0), device = self.device)
    fake = torch.zeros(fake_batch.size(0), device = self.device)


    y_pred = self.netD(real_batch)
    y_pred_fake = self.netD(fake_batch.detach())
    
    real_v_fake = (y_pred- torch.mean(y_pred_fake))
    fake_v_real = (y_pred_fake - torch.mean(y_pred))

    real_v_fake = torch.reshape(real_v_fake,(real_batch.size(0),1))
    fake_v_real = torch.reshape(fake_v_real,(real_batch.size(0),1))
    valid = torch.reshape(valid, (real_batch.size(0),1))
    fake = torch.reshape(fake, (real_batch.size(0),1))
    
    real_v_fake = self.loss(real_v_fake, fake)
    fake_v_real = self.loss(fake_v_real, valid)

meaning torch.nn.BCEWithLogitsLoss still complains about different shapes even after pytorch successfully reshapes them to the exact same shape (real_batch.size(0),1).