Thank you for your reply.
I think that may be happening because my output are not raw logits and I use sigmoid as activation function when training. It is a 2 class problem, though.
The shape of logits is: torch.Size([2, 1, 256, 256])
Well, it seems I messed up and I was getting the batch. I tried to use logits[0] with softmax but now the results is always the same:
tensor([[[0.0039, 0.0039, 0.0039,  ..., 0.0039, 0.0039, 0.0039],
         [0.0039, 0.0039, 0.0039,  ..., 0.0039, 0.0039, 0.0039],
         [0.0039, 0.0039, 0.0039,  ..., 0.0039, 0.0039, 0.0039],
         ...,
         [0.0039, 0.0039, 0.0039,  ..., 0.0039, 0.0039, 0.0039],
         [0.0039, 0.0039, 0.0039,  ..., 0.0039, 0.0039, 0.0039],
         [0.0039, 0.0039, 0.0039,  ..., 0.0039, 0.0039, 0.0039]]],
       device='cuda:0')

torch.Size([1, 256, 256])