Right now we use AlterOpLayout pass that automatically decides which layout based on the target hw back ends.
Given that we also want to offer the flexibility to pragmatically add pass pipelines, and there has been increasing need for converting between layouts(e.g. NHWC to NCHW), we might want to also introduce a Layout conversion pass that a user can specify. This would provide additional optional flexibility that some of our current frontends need Example usage:
mod_nhwc = relay.from_tflite(model) mod_nchw = relay.transform.ConvertLayout("NCHW", "NHWC")(mod_nhwc)
Let us use this thread to discuss the API choices, possible implementation problems.