SIGN IN SIGN UP

Improve codegen for aten.permute (#3087)

Summary:
Pull Request resolved: https://github.com/pytorch/executorch/pull/3087

In the generated code, it uses CPU as reference implementation.

Tricky part happens when CPU modify the stride for some indexing operations like `permute`, leading the return Tensor with a non-continous stride.

When we create a `vk_out` tensor based on this non-continous tensor with `at::empty_like`, the `vk_out` tensor inherits the stride property. Leading to wrong answer when moving data back from staging.

As a solution, we add `.continous()` to after `at::empty_like` to revert back to default stride.
ghstack-source-id: 222417364

Reviewed By: SS-JIA

Differential Revision: D56095204

fbshipit-source-id: d42777ec876e47465c892331b5f854203c9fb8ef
J
Justin Yip committed
28be9d6800187d2060e70a48919fa78920117c11
Parent: de00717
Committed by Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com> on 4/17/2024, 8:30:02 PM