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, 8, 8])
12 Y = helper.make_tensor_value_info(
'Y', TensorProto.FLOAT, [1, 1, 2, 2])
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,
'12_maxp_a.onnx')