Unsqueezing / viewing seems to be the right thing to do.
You didn’t ask but just in case: It is good to avoid loops of incremental cat’s and instead collect things to cat into a vector and put them in in one go.
An alternative if you know the size in advance is to allocate a torch.empty of the new size and assign to that.