title: The im2col algorithm for ND input
body: <p>I am trying to write my own im2col algorithm for input dimensions > 2D.
  Currently I am looking at the Matlab im2col implementation. However, I cannot find any documentation regarding what is going on for any input of more than 2 dimensions. </p>
  
  <p>I do get an output if I feed in a 3D tensor into the function. However I don't really understand how you get from 2D to ND. The fact that this isn't mentioned in the documentation suggests that its something straightforward, still, I don't get it. </p>
  
  <p>Heck, I dont even understand why the size of the output matrix is the size it is. </p>