As given in the docs, the class dimension should be in dim1, so this would work:
output = torch.rand(batch_size, number_of_classes, sequence_length)

In your training script, you could permute the output to match these dimensions.