Yes, sigmoid_cross_entropy_loss_with_logits should be equivalent to nn.BCEWithLogitsLoss.
However, if you’re dealing with a multi-class classification, i.e. only one positive class per sample, you would usually use nn.CrossEntropyLoss. You could use nn.BCEWithLogitsLoss for a multi-label classification, i.e. more than one positive class per sample.
Are you using a batch size of 1?
If using the mean doesn’t work, you might want to weight both losses to get approx. the same range.