Hi, Above you have the encoder, which can be done without the loop.
For decoding, I don’t think you can simply pass an entire sequence, because you need to make a prediction at each timestep before moving to the next one. The RNN is informed by both the encoder, and the previously predicted item in the sequence. You can, of course, still use a batch, just not a batch of an entire sequence.
E.g. a tensor of (batch_size, 1, dims) should be doable.