For binary classification you should can use the BCELoss or BCEWithLogitsLoss. The difference between the two is that BCELoss assumes the input is probabilities that are computed using nn.Sigmoid() in your last layer. On the other hand, BCEWithLogitsLoss assumes that the inputs are logits without passing through Sigmoid activation.
Finally, in both cases (BCELoss or BCEWithLogitsLoss) the input and target should be 1-dimensional tensors with size [batch_size].