Whether the repo of https://github.com/tlc-pack/relax can emit the relay_ir level text

[1] In the repo of “https://github.com/tlc-pack/relax”, i tested the “apps\relax_examples\resnet.py”, found that the “print(R.parser.astext(relax_mod))” will ouput the tir level text,i wonder whether this repo can output the relay_ir level text, if can ,how i get the output. [2] If can not , are there plans to add this feature? Or the reason not to add this feature.

Hi @xiaolong18,

Thanks for playing with Relax! print(R.parser.astext(relax_mod)) actually prints out the whole IRModule, which contains both the Relax functions and TIR PrimFuncs. Please search for “@relax.function” in the printed text, you will find the Relax IR as below:

If you just want to see the relax function, you can do print(R.parser.astext(relax_mod["main"])).

Thank you very much :grinning:, I have another question, there is already provided interface “relay_translator.from_relay()" to convert relay_module to relax_module, is there any similar function to convert relax_module to relay_module in the future? Or it can be done in other ways?

If there is a need we will do so, but so far we haven’t seen a need. :slight_smile:

Ok,Thank you very much :slightly_smiling_face: