Unfortunately, I cannot debug the issue if you don’t provide a code snippet I could run locally.
If you cannot provide executable code, add print statements after all tensors and check the shape.
Make sure the batch size stays the same and no view or reshape operation is changing it.