Following the tutorials on compilation. I tried hands-on for keras and tensorflow model compilation.
Then, I have realized that there are certain differences in keras and tensorflow models tutorial documentation at “Compile the Model with Relay” and “Execute on TVM”.
-
[Keras] “Compiling the Model with Relay” and “Execute on TVM” is at
-
[Tensorflow] “Compiling the Model with Relay” and “Execute on TVM” is at
Why do I witness changes like the following in the codes from above links while compiling and running keras and tensorflow models?
-
executor = relay.build_module.create_executor(“graph”, mod, ctx, target) in Keras and lib = relay.build(mod, target=target, target_host=target_host, params=params) in Tensorflow while building relay.
-
tvm_out = executor.evaluate()(tvm.nd.array(data.astype(dtype)), params) in Keras and m = graph_runtime.GraphModule(lib[“default”](ctx)) in Tensorflow while running the graph.
Thank you!