My target and logits both have the same shape. I have generated binary masks for the target corresponding to each class. And the Unet model outputs logits for each class.
Both have the shape --> [batch_size, nb_classes,h,w]