E.g. if you are working with variable input shapes and would like to classify each sample in the temporal dimension, you could just use a target with the same (variable) sequence length.

I think I could do this be using the hidden state output of the LSTM with hidden.repeat(length), however it’s a little trickier with a batch of examples with different lengths, right? (I think I could still do it by repeating each hidden state separately and then using pack_sequence to pass these into the decoder)

On the other hand, you might want to classify the complete sequence to a specific class, so while the input would have a (variable) temporal dimension, your target should have a class index for each sample.

I understand this approach too. I think this is perhaps the simplest case.
What I’m wondering most about is things like language translation where the output is not length 1 and it is also not necessarily the length of the input. Do you know how you’d do that? Especially while still using batches?
Thanks,
Jack