As we have pass manager in Relay optimization and mostly use module as optimization unit, I suggest we change the Relay frontend converter to return a module instead of a function. The change also makes easier add prelude and global var in the frontend converter in the future. Frontend converter will preset the main function in the module to the converted function as ``` mod[mod.entry_func] = converted_func ``` Correspondingly we need to change the relay executor to be able to run the converted module. I use MxNet as an exmple to show the proposed change: ``` mod, _ = relay.frontend.from_mxnet(mx_sym, shapes, dtype) for kind in ["graph", "debug"]: intrp = relay.create_executor(kind, mod=mod, ctx=ctx, target=target) op_res = intrp.evaluate()(*args) ``` When executor is given no input, it will execute the `mod.entry_func` by default.
cc @jroesch @tqchen @wweic @zhiics -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/dmlc/tvm/issues/3346