Thank you for your answer,
So the formula below describes the CrossEntropyLoss function implemented in Pytorch.

image.png827×105 10 KB

From what I understand, this function never uses the label (or target) of the sample to compute the probability output for  class, since x[class] refers to the probability of our sample belonging to class, and sum(exp (x[j]) is just the sum over the exponential of outputs for all classes. So where does Pytorch actually use the label of the sample in this loss function? I feel I’m missing something