The right way is to unsqueeze and expand on the S1 and then use a single cat.
Regarding the things above: It’s not applicable in your situation anyway, but you should never(!) incrementally cat results. It’s quadratic in complexity for something that should be linear. If you do something like that, append to a Python list and feed it to cat at the end.
Best regards
Thomas