Yes, I mean, it’s something deterministic and ordered. You may want to have a look to this.

  
    
    
    Difference between 2 reshaping operations (reshape vs permute) nlp
  
  
    Im not sure about reshape. 
Permute is a multidimensional rotation saying somehow. It keeps the data ordering. View (which is another reshaping method) maps from one dimensionality to another sequentially reading data from the upper dimensions to the lower ones. 
So if you want fuse two dimensions into one, you have to apply it over contiguous dimensions or u will modify the data ordering
  


It’s really linked to how many dimensions does each dimension has.
Think that it works in a “FIFO” way. the 1st element of B will be also the 1st element taken for C.
So in the end A–>C is same than A–>B–>C if you don’t modify the ordering of the elements in B.
Lastly think that, since it’s ordered, it respects spatial structure. What does this mean?
Imagine you have a tensor
A (2,5,7,7)
You reshape it as
A’(52,1,7,7)
Then you apply a convolution and get
B’ (52,1,5,5)
if you reshape B back to
B ( 5,2,5,5)
The spatial structure of H and W remains since the ordering of the elements is equal to the ordering of A.