If I have a 2D tensor (matrix)  of size say (5,6), how do I transform it into a (10,3) matrix  where each column in the resultant matrix is formed by stacking two consecutive columns in the initial matrix, with a step size of 2. That is, first two columns in the initial matrix are stacked to form the first column in the resultant matrix , 3rd and 4th columns in the initial matrix stacked to obtain the second column in the new matrix and likewise
In a more general sense I want to slide a window, width-wise where all columns in a window are stacked to form single column