Thanks, your solution gave me the desired shape but the content is still not in the correct order.
I realised that I should have explained it in a more intuitive way; it is basically doing a hstack for each data in a batch. So I manage to do it through:
x = [torch.cat(i.chunk(n_chunk, dim=1), dim=-1) for i in x.chunk(batch_size, dim=0)]
x = torch.cat(x, dim=0).squeeze(1)