you are the best! @ptrblck
But is there need a contiguous() after permute. And how you work it out？right now I regard the array as a one-dimension  list and then reshape it.
Anyway it really helps! thank you very  much!