Nikronic:

BCELossWithLogits()


Thank you so much for the swift input. Thank you this seems to address the original type error - tensor object is not callable, now I am getting the error - RuntimeError: The size of tensor a (2) must match the size of tensor b (32) at non-singleton dimension 1.
I used the the following class object;
#code source: https://github.com/pytorch/pytorch/issues/751 3
class StableBCELoss(nn.modules.Module):
   def __init__(self):

         super(StableBCELoss, self).__init__()

   def forward(self, input, target):

         neg_abs = - input.abs()

         loss = input.clamp(min=0) - input * target + (1 + neg_abs.exp()).log()

         return loss.mean()

It looks like the issue is continued to be the way criterion is implemented, may not be tensor size/dimension. My codes seems to be infested with bugs, any additional help is highly appreciated. Thank you.