You could try to use nn.BCEWithLogitsLoss, but note that the loss values might be unexpected, as described here 1.
Alternatively, nn.MSELoss could work or have a look at label smoothing for NLLLoss 1.