yes i  use crossEntropyLoss. i didnt understand what you mean by class dimension but my dense layer  takes input a vector of size 256 which is output of a LSTM and output is
1 dimensional vocabulary sized vector