aboutsummaryrefslogtreecommitdiffstats
path: root/config-model/src/test/integration/onnx-model/files/create_dynamic_model.py
blob: 83974fc70047009977155e0198f55ab878ba1aa1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
# Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

import onnx
from onnx import helper, TensorProto

INPUT = helper.make_tensor_value_info('input', TensorProto.FLOAT, ["batch", "sequence"])
OUTPUT = helper.make_tensor_value_info('output', TensorProto.FLOAT, ["batch", "sequence"])

nodes = [helper.make_node('Identity', ['input'], ['output'])]
graph_def = helper.make_graph( nodes, 'simple_scoring', [INPUT], [OUTPUT])
model_def = helper.make_model(graph_def, producer_name='create_dynamic_model.py')
onnx.save(model_def, 'dynamic_model.onnx')