Is it possible to implement CrossEntropy like this (equivalent of BCELoss) ? I know it’s a sum over plog(q) but not sure how to implement it by myself. If it works, this could be a solution to my problem (I need both MSE and BCE loss). Thanks for your answer.