BCELoss is in torch.nn: https://pytorch.org/docs/stable/nn.html#bceloss
If you want to use torch.nn.functional, it has binary_cross_entropy(): https://pytorch.org/docs/stable/nn.functional.html#binary-cross-entropy