Fix XNNPACK Prelu for non-4d tensors#18624
Conversation
Summary: Prelu with non-4d tensors is broken on xnnpack. This is because the channels last reshape pass assumes that it must be 4d. Update the pass to leave non-4d tensors unmodified. We still treat all 4d tensors as NHWC, though theoretically you could have a 4d tensor + prelu in a non-CV model, but I'm inclined to just leave this for now. We can add smarter 4d handling later if motivated. Differential Revision: D98987039
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/18624
Note: Links to docs will display an error until the docs builds have been completed.
|
|
@GregoryComer has exported this pull request. If you are a Meta employee, you can view the originating Diff in D98987039. |
This PR needs a
|
Summary: Prelu with non-4d tensors is broken on xnnpack. This is because the channels last reshape pass assumes that it must be 4d. Update the pass to leave non-4d tensors unmodified. We still treat all 4d tensors as NHWC, though theoretically you could have a 4d tensor + prelu in a non-CV model, but I'm inclined to just leave this for now. We can add smarter 4d handling later if needed.
Differential Revision: D98987039