SIGN IN SIGN UP

Temporary fix of different memory formats between Pytorch and TOSA (#2371)

Summary:
- This patch will be reverted once Github issue https://github.com/pytorch/executorch/issues/1110 is resolved
- Torch graph operators like Conv2d are using NCHW formats while the TOSA equivalents are using NHWC formats.
- In the previous implementation, a pair of transpose operators are added around the TOSA Conv2d operator to cope with the memory format differences.
- In this patch, it removes those intermediate transposes around operators like Conv2d.
- Instead, we're transposing the inputs and outputs around the whole lowered graph and the Tosa compiler assumes the torch graph is in NHWC format so all the input/output shapes can match.

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

Reviewed By: mcr229

Differential Revision: D55078729

Pulled By: digantdesai

fbshipit-source-id: 248d234e7ca43ecde8d5e5cf9a1773f0d3b89a62
J
Jerry Ge committed
5826af6f7132db8ea17af490ed2c0ad3be5bef10
Parent: 80e3989
Committed by Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com> on 3/20/2024, 3:57:56 PM