Thanks for the update.
If I understand the use case correctly you might then be working on a multi-class sequence classification, i.e. each time step has only a single label?
In this case, you could use nn.CrossEntropyLoss with a model output in the shape [batch_size, nb_classes, seq_len] and a target in the shape [batch_size, seq_len] containing the class indices in the range [0, nb_classes-1].