Just for anyone else who finds this from Google (as I did), BCEWithLogitsLoss 858 now does the equivalent of sigmoid_cross_entropy_with_logits from TensorFlow. It is a numerically stable sigmoid followed by a cross entropy combination.