You can use binary cross-entropy: BCELoss — PyTorch 1.8.1 documentation.
Note that you can also express the problem with cross-entropy and two classes: one of the classes is ‘0’ and the other is ‘1’. You can simply use the softmax output of the ‘1’ class as your prediction in this case.