Hi there, thank you for your quick and detailed reply.
Actually, each element in the output, namely A(i, j), is a single sample. So num_items is not number of classes, but just another dimension of samples like batch_size. The value of A(i, j) is the output of a linear layer, expected to be as close as possible to the ground true value of class, which is B(i, j). In the target B, element values are indeed within (0, C-1) strictly.
So I think it can be seen as a multi-class classification problem. The issue is to correctly classify each element in output A, compared to target B. Problem is output A does not have num_classes dimension, can I just expand A with classes dimension in some way?