I’m not sure I fully understand the issue, so please correct me if I’m misunderstanding something.
Based on your explanation you are already cropping the sequences to a MAX_SEQ length and are also padding them if needed, which is great!
However, now you are somehow changing the size of dim0 in some of the tensors, while others are still using a size of 1, which causes the issue?
If so, why don’t all tensors increase the size in this particular dimension?