The detailed problem is as follows:
I have a mixture of Labelled Sample Group and Unlabeled Sample Group. For some special reason, I have to mix those samples in a same mini-batch to train a classification network, with CrossEntropyLoss. So I need to ignore these unlabeled samples when computing the CrossEntropyLoss.
I tried to assign a pseudo label to these unlabeled samples and set the option weight in CrossEntropyLoss 2 to be (zero) corresponding to the pseudo label , but found that it wouldn’t satisfy my demand. First the output turns to be  C+1 vector. Second and most importantly, though the loss on the pseudo class is ignored, if the prediction of an unlabeled data have large values on other indexes, it still generate large loss. I need those samples contribute exactly 0 to the CrossEntropyLoss.
So will someone kindly help me with this issue? Thx a lot.