You will get a loss close to zero (in this case you’ll see the print outputs an exact zero, although the value might just underflow), if the logit for the target class is very high:
x = torch.ones(1, 21) * (-10000)
x[0, 3] = 10000
target = torch.tensor([3])

loss = F.nll_loss(F.log_softmax(x, 1), target)
print(loss)
> tensor(0.)