2 import tvm.relay
as relay
6 onnx_model = onnx.load(
'i1_alexnet.onnx')
7 in_shape = (1,3,224,224)
8 shape_dict = {
'data_0': in_shape}
9 mod, params = relay.frontend.from_onnx(onnx_model, shape_dict)
12 with relay.build_config(opt_level=0):
13 graph, lib, params = relay.build(mod, target, params=params)
15 out_lib = open(
"i1_alexnet.ll",
"w")
16 out_lib.write(lib.get_source())
18 out_graph = open(
"i1_alexnet.json",
"w")
19 out_params = open(
"i1_alexnet.params",
"w")
20 out_graph.write(graph)