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, [1, 1, 32, 32])
12 Y = helper.make_tensor_value_info(
'Y', TensorProto.FLOAT, [1, 1, 10, 10])
14 maxp1 = helper.make_node(
25 graph_def = helper.make_graph(
32 model_def = helper.make_model(graph_def, producer_name=
'benchmarks')
34 onnx.checker.check_model(model_def)
35 model_def = shape_inference.infer_shapes(model_def)
36 onnx.checker.check_model(model_def)
37 model_def = optimizer.optimize(model_def)
38 onnx.checker.check_model(model_def)
40 onnx.save_model(model_def,
'13_maxp_b.onnx')