Based on the target shape it seems you are dealing with a binary classification.
If you are using nn.BCEWithLogitsLoss, then your model would have to output a single logit, while it seems to be returning currently 2 outputs.