Solved by KFrank in post #2 
              
              
                Hello Thao! 

I don’t fully understand your use case, but I would proceed as follows: 
Use CrossEntropyLoss for the classification part of your model.  To 
do this, your model should output raw-score logits,, not probabilities, 
so the last layer of your model should most likely be a Linear layer 
w…