[Relay][topi/nn] Ways to get layout of each operator

We had discussion before regarding whether to put layout as part of type system. At the time the conclusion was not to complicate type, but have layout a separate property during the layout inference pass. Part of the reasons is layout is not a must have, and is not quite well-defined, e.g., why the name “NCHW” but not “ABCD”. but maybe we shall expose an API to allow users get the inferred layout after running layout inference pass.

3 Likes