import torch
x = torch.randn(2, 3, 4, 5)  #  [batch_size, n_chunk, input_size_1, input_size_2]
x_input = x.view(-1, 1, 4, 5)  # [batch_size * n_chunk, 1, input_size_1, input_size_2]  
x_bar = model(x)  # model is an CNN auto-encoder, for example

As the example shows, I have x with the shape described in comment; there is n_chunk because I split each input to chunks. I use view in order to reshape it as the input to model which is an CNN autoencoder with batch size =  batch_size * n_chunk and 1 channel. So x_bar has the same shape.
My question is, how to reshape x_bar into the shape of [batch_size, input_size_1, input_size_2 * n_chunk] without messing up the data order as it will with view?
To clarify, x is a batch of audio spectrogram which is split into n_chunk chunks, with input_size_1 frequency bands and input_size_2 time frames; which is why I’d like to concatenate chunks along the time axis.