I believe you are talking about BCELoss
http://pytorch.org/docs/nn.html#torch.nn.BCELoss 529
or http://pytorch.org/docs/nn.html#binary-cross-entropy 348
but you’d have to apply sigmoid activation yourself before that