You can use either nn.BCELoss() or nn.CrossEntropyLoss().
For nn.BCELoss(), your network shall have one output node with Sigmoid output activation.
For nn.CrossEntropyLoss(), your network shall have two output node without any activation.