In the TVM library, when the _relay.build_module.build()_
is used, what is the output result both after relay.build
and tvm.build
And what is the difference and need for two parameters as output - graph and library - which are later used to run the graph or create a graph runtime ?
For example in this code :
opt_level = 3
target = tvm.target.cuda()
with relay.build_config(opt_level=opt_level):
graph, lib, params = relay.build_module.build(
net, target, params=params)
What are the outputs graph, lib ? Can we use just one of them to generate a graph runtime or do we always have to use both of them like below :
# create random input
ctx = tvm.gpu()
data = np.random.uniform(-1, 1, size=data_shape).astype("float32")
# create module
module = graph_runtime.create(graph, lib, ctx)
# set input and parameters
module.set_input("data", data)
module.set_input(**params)
# run
module.run()
# get output
out = module.get_output(0, tvm.nd.empty(out_shape)).asnumpy()