title: Vectorized reshaping of matrix by blocks
body: <p>I have this matrix</p>
  
  <pre><code>[1,2,3;
   4,5,6;
   7,8,9;
   10,11,12;]
  </code></pre>
  
  <p>I want to reshape it in block of 2,  stack rows in multiples of 2. So the output would look like</p>
  
  <pre><code>[1,2,3,7,8,9;
   4,5,6,10,11,12]
  </code></pre>
  
  <p>In general I want to reshape it in <code>(N^2) x M</code> matrix to <code>N x (N*M)</code> matrix in blocks. Any ideas?</p>