The crossEntropy is used for classification problems where the length of output of ur network is the number of classes u have
So if u pass an image through the NN it outputs a length of C values where C=classes. So the shape of this output is (N, C) N= batch size, C is number of classes what crossentropy does it to then find the probability score of the outputs with softmax and then compute the negative log likelyhood between the scored output and the Target.
So in other words crossEntropy only take values with shape(N, C).