In PyTorch nn.NLLLoss() function, when we apply it directly to calculate loss value wrt input and Target value, we get a error mentioning “bool value of Tensor with more than one value is ambiguous”.
When we mention something like criterion=nn.NLLLoss() and then apply criterion (input,Target) we get the loss tensor output. Any idea why this happens?