Thanks @ptrblck for the reply. I really appreciate it.
I should have put the problem statement too. The end goal is segmentation in an image i.e. I have two classes only and each pixel/feature in the image can belong to one class.
I think it would come under binary class and single label. I think so as per what I read here 1.
I read a discussion here 6 but couldn’t ascertain which one I should use.
Does it mean I should use nn.CrossEntropyLoss. I am sorry. I did read few forums but wasn’t sure what is going wrong so asked this question.