Solved by AlphaBetaGamma96 in post #2 
              
              
                If you just to reshape your input data you can just use torch.reshape, 
let’s assume you have some data of data = torch.randn(B,CH,W,H) and (for the sake of clarity) B=2, CH=2, W=4, H=4 this would give 
>>> data=torch.randn(B,CH,W,H)
>>> data
tensor([[[[-0.7966, -0.0109,  0.8348,  1.4254],
         …