I assume that 32 is your batch size. torch.nn.CrossEntropyLoss() is expecting you to pass output with dimensions [batch_size, n_classes, seq_len] and training label with dimensions [batch_size, seq_len] which cointains training class labels.
Also you can pass input with dimensions (N,C) and target with dimensions (N), from the documentation.
I do not know what your task is but I hope this will help you.