[Memory-layout infra] Handle graphs not exportable in channels-last format
@MartinPavella is already working on this.
Since Jul 23, 2026.
- Dominant language
- Python
- Stars
- 5k
- Forks
- 1.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 581
Description
Part of #19299. Some graphs are not exportable in channels-last and so they will not be able to use the solution implemented in #20095, but we still want to offer a way of avoiding runtime-permutes
by supplying channels-last data. I suggest an analogue to the QuantizeInputs/QuantizeOutputs passes which would be PermuteInputs/PermuteOutputs`.
Similarly to the Quantize passes these would change the expected type of tensor to be run through the graph. Before the passes, inputs/outputs are (N, C, H, W), and after the pass
inputs/outputs are (N, H, W, C) with extra permutes inserted to ensure the graph does not change. These permutes will later fuse with the permutes inserted by the ToContiguousChannelsLastPass.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.