diff options
author | Lester Solbakken <lesters@oath.com> | 2021-05-19 14:41:57 +0200 |
---|---|---|
committer | Lester Solbakken <lesters@oath.com> | 2021-05-19 14:41:57 +0200 |
commit | 77807b53619a6b1449610c598f391b024eb52930 (patch) | |
tree | 65117eab0d5e5cafee49a04b10d1c79f1e3431fa /model-integration/src/test/models/onnx/cast_bfloat16_float.py | |
parent | bd35a66573c5b6cbf05f2d875cef00817b7d23c1 (diff) |
Revert "Revert "Add ONNX-RT evaluator to model-integration module""
This reverts commit 97080252fac0ba45b58f9d0efb56603da518428f.
Diffstat (limited to 'model-integration/src/test/models/onnx/cast_bfloat16_float.py')
-rwxr-xr-x | model-integration/src/test/models/onnx/cast_bfloat16_float.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/model-integration/src/test/models/onnx/cast_bfloat16_float.py b/model-integration/src/test/models/onnx/cast_bfloat16_float.py new file mode 100755 index 00000000000..14b05347262 --- /dev/null +++ b/model-integration/src/test/models/onnx/cast_bfloat16_float.py @@ -0,0 +1,24 @@ +# Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. + +import onnx +from onnx import helper, TensorProto + +INPUT_1 = helper.make_tensor_value_info('input1', TensorProto.BFLOAT16, [1]) +OUTPUT = helper.make_tensor_value_info('output', TensorProto.FLOAT, [1]) + +nodes = [ + helper.make_node( + 'Cast', + ['input1'], + ['output'], + to=TensorProto.FLOAT + ), +] +graph_def = helper.make_graph( + nodes, + 'cast', + [INPUT_1], + [OUTPUT], +) +model_def = helper.make_model(graph_def, producer_name='cast_bfloat16_float.py', opset_imports=[onnx.OperatorSetIdProto(version=12)]) +onnx.save(model_def, 'cast_bfloat16_float.onnx') |