Solved by Nikronic in post #12 
              
              
                Ow, sorry. 
I used the tensor in the first post. 

a.unfold(2, 2,2).unfold(3, 2,2).contiguous().view(2, 6, 2, 2)

by the way, as I told you only need to work with dim and number of unfold functions. Easy does it. 
Bests 
Nik