The output of my network is a tensor of size torch.Size([time_steps, 20, 29]).
20 is the batch size, and 29 is the number of classes. time_steps is variable and depends on the input.
My targets has the form torch.Size([time_steps, 20]).
How can I calculate the loss using nn.CrossEntropyLoss function?
It should be noticed that the loss should be the sum of the loss of time_steps cross entropy loss operations.