Here 9’s the documentation about CrossEntropyLoss.
outputs: shape (N, 3), type Float or Double or Half, without softmax
batch_y: shape (N,), type Long, the labels.
CrossEntropyLoss equals to LogSoftmax + NLLLoss