Lowering Relay ops through TIR to C Code?

Hello everyone,

I’m trying to wrap my head around the lowering pipeline from a PyTorch/TF model down to C code. I have found the VTA example which seems to go from Relay → TE defined ops → C. However, from reading the docs and other forum posts, it seems like using TIR directly instead of TE is the more moden way. When I look at the VTA intrin examples, they all define the operations as a tensor expression and especially when I want to use the new AutoTuning tools, using TIR seems like a better choice. Are there any examples for this, or is this limited to Relax?

Generating TIR from TE defined ops is possible with the te.create_prim_func function. Then both TIR schedules for manual scheduling and meta_schedule for auto scheduling can be done.

Then lowering this to C can be done the same way it is already done I guess.