No, that’s alright.
I was just wondering, about the other example, since there were some repetitions in the target:
labels = torch.tensor([2, 5, 2, 1, 6, 3])

This sample would have class2 “twice”. Is this a typo?
Also, you should use 0-based indices, i.e. your targets should be in the range [0, nb_classes-1].
I’m not sure, what this means:



 ViniLL:

however in my case 0 still means a class.


class0 is still a valid class is will be set to 1, if the labels tensor indicates it:
labels = torch.tensor([1, 0, 5])
labels = labels.unsqueeze(0)
target = torch.zeros(labels.size(0), 6).scatter_(1, labels, 1.)
print(target)
> tensor([[1., 1., 0., 0., 0., 1.]])