4 from onnx
import helper, shape_inference, optimizer
5 from onnx
import numpy_helper
6 from onnx
import AttributeProto, TensorProto, GraphProto
9 X = helper.make_tensor_value_info(
'X', TensorProto.FLOAT, [64])
10 Y = helper.make_tensor_value_info(
'Y', TensorProto.FLOAT, [64])
14 Z = helper.make_tensor_value_info(
'Z', TensorProto.FLOAT, [64])
16 mul1 = helper.make_node(
22 graph_def = helper.make_graph(
24 name=
'vecmul_b_model',
29 model_def = helper.make_model(graph_def, producer_name=
'benchmarks')
31 onnx.checker.check_model(model_def)
32 model_def = shape_inference.infer_shapes(model_def)
33 onnx.checker.check_model(model_def)
34 model_def = optimizer.optimize(model_def)
35 onnx.checker.check_model(model_def)
37 onnx.save_model(model_def,
'02_vecmul_b.onnx')