Solved by johann-petrak in post #2 
              
              
                Maybe use 
h_n.transpose(0,1),contiguous(),view(batchsize, -1)

The contiguous() call is needed because transpose() copies data, but I think this cannot be done without copying data, or does anyone else know a better solution?