Got this from the documentation

m = nn.Sigmoid()
loss = nn.BCELoss()
#input is of size N x C = 1 x 3
input = torch.randn(3, requires_grad=True)
print(input)
#each element in target has to have 0 <= value < C
target = torch.empty(3).random_(2)
print(m(input))
print(target)
output = loss(m(input), target)

print(output)
OUTPUT

tensor([-0.8840,  0.7303, -0.5842], requires_grad=True)
tensor([0.2923, 0.6749, 0.3580], grad_fn=)
tensor([0., 1., 0.])
tensor(0.3940, grad_fn=)

Questions
This is the values after sigmoid which is btw 0,1
[0.2923, 0.6749, 0.3580] <-- is this 3 y-predictions ?
this is y-actual
tensor([0., 1., 0.])
In this case since the 2nd element will round to 1 we predict correctly for all the 3 elements
How does loss compare both and obtain 0.394?
Thanks