Shuffling the order of tensors