[RFC] TVMScript Metaprogramming

Yes, that’s right. Actually you can write imperative code to construct IR graph now, by calling IR node constructors from tvm.tir.stmt|expr manually. The new things behind F4 are:

  1. IRBuilder API, which can be used to construct IR nodes in a more concise way compared to calling node constructor directly.
  2. The ability to embed these functions inside TVMScript. This means you can use imperative code to construct small fragments inside a large T.prim_func.