Solved by ptrblck in post #2 
              
              
                The view operation just changes the tensor metadata without triggering a copy. 
After the permute call this won’t be possible anymore as explained in the error message and you would either have to use reshape (which copies the data and performs the view op) or call .contiguous() before the view oper…