You have two basic alternatives:
- Use padding (& packing). That’s a standard practice to handle batch sequences of different lengths.
- Organize your batches in such way that all sequences withing one batch have the same length.
You have two basic alternatives: