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,64])
13 Z = helper.make_tensor_value_info(
'Z', TensorProto.FLOAT, [1,64])
15 smax1 = helper.make_node(
21 graph_def = helper.make_graph(
23 name=
'softmax_b_model',
28 model_def = helper.make_model(graph_def, producer_name=
'benchmarks')
30 onnx.checker.check_model(model_def)
31 model_def = shape_inference.infer_shapes(model_def)
32 onnx.checker.check_model(model_def)
33 model_def = optimizer.optimize(model_def)
34 onnx.checker.check_model(model_def)
36 onnx.save_model(model_def,
'07_softmax_b.onnx')