Which criterion are you using?
The shape should be fine for a two class classification problem using nn.CrossEntropyLoss.
However, your target should contain the class indices in the range [0, nb_classes-1], so [0, 1] in your case.