Solved by albanD in post #2 
              
              
                Hi, 
CELoss can be implemented without having to create the one hot encoding. So to reduce memory needs, our CE function takes the label as a LongTensor that contains the index to the correct class.