diff options
author | Lester Solbakken <lesters@users.noreply.github.com> | 2020-10-27 15:23:17 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-27 15:23:17 +0100 |
commit | de5e15528fca545b2a9ccbb1386c5590e11fa383 (patch) | |
tree | 7d4670986c2a8a8c097a29b575a4bb8d3bad4f87 /config-model/src/test/integration | |
parent | 4d64cbe4e531cb7be1061f1f54809d1d0a1b0061 (diff) |
Revert "Lesters/revert revert resolve onnx model types"
Diffstat (limited to 'config-model/src/test/integration')
8 files changed, 5 insertions, 200 deletions
diff --git a/config-model/src/test/integration/onnx-model/files/create_dynamic_model.py b/config-model/src/test/integration/onnx-model/files/create_dynamic_model.py deleted file mode 100755 index 55df3a557e9..00000000000 --- a/config-model/src/test/integration/onnx-model/files/create_dynamic_model.py +++ /dev/null @@ -1,12 +0,0 @@ -# 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 = 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') diff --git a/config-model/src/test/integration/onnx-model/files/create_model.py b/config-model/src/test/integration/onnx-model/files/create_model.py deleted file mode 100755 index 10ff92c2eda..00000000000 --- a/config-model/src/test/integration/onnx-model/files/create_model.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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('first_input', TensorProto.FLOAT, [2]) -INPUT_2 = helper.make_tensor_value_info('second/input:0', TensorProto.FLOAT, [2]) -INPUT_3 = helper.make_tensor_value_info('third_input', TensorProto.FLOAT, [2]) -OUTPUT_1 = helper.make_tensor_value_info('path/to/output:0', TensorProto.FLOAT, [2]) -OUTPUT_2 = helper.make_tensor_value_info('path/to/output:1', TensorProto.FLOAT, [2]) -OUTPUT_3 = helper.make_tensor_value_info('path/to/output:2', TensorProto.FLOAT, [2]) - -nodes = [ - helper.make_node( - 'Add', - ['first_input', 'second/input:0'], - ['path/to/output:0'], - ), - helper.make_node( - 'Add', - ['third_input', 'second/input:0'], - ['path/to/output:1'] - ), - helper.make_node( - 'Add', - ['path/to/output:0', 'path/to/output:1'], - ['path/to/output:2'] - ), -] -graph_def = helper.make_graph( - nodes, - 'simple_scoring', - [INPUT_1, INPUT_2, INPUT_3], - [OUTPUT_1, OUTPUT_2, OUTPUT_3] -) -model_def = helper.make_model(graph_def, producer_name='create_model.py') -onnx.save(model_def, 'model.onnx') diff --git a/config-model/src/test/integration/onnx-model/files/create_unbound_model.py b/config-model/src/test/integration/onnx-model/files/create_unbound_model.py deleted file mode 100755 index abf733ea43f..00000000000 --- a/config-model/src/test/integration/onnx-model/files/create_unbound_model.py +++ /dev/null @@ -1,12 +0,0 @@ -# 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 = helper.make_tensor_value_info('input', TensorProto.FLOAT, [-1, 2]) -OUTPUT = helper.make_tensor_value_info('output', TensorProto.FLOAT, [-1, 2]) - -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_unbound_model.py') -onnx.save(model_def, 'unbound_model.onnx') diff --git a/config-model/src/test/integration/onnx-model/files/dynamic_model.onnx b/config-model/src/test/integration/onnx-model/files/dynamic_model.onnx deleted file mode 100644 index 6bbdad2d76e..00000000000 --- a/config-model/src/test/integration/onnx-model/files/dynamic_model.onnx +++ /dev/null @@ -1,13 +0,0 @@ -create_dynamic_model.py:x - -inputoutput"Identitysimple_scoringZ$ -input - -batch - -sequenceb% -output - -batch - -sequenceB
\ No newline at end of file diff --git a/config-model/src/test/integration/onnx-model/files/model.onnx b/config-model/src/test/integration/onnx-model/files/model.onnx deleted file mode 100644 index f3898205c6a..00000000000 --- a/config-model/src/test/integration/onnx-model/files/model.onnx +++ /dev/null @@ -1,34 +0,0 @@ -create_model.py:í -4 -first_input -second/input:0path/to/output:0"Add -4 -third_input -second/input:0path/to/output:1"Add -; -path/to/output:0 -path/to/output:1path/to/output:2"Addsimple_scoringZ -first_input - - -Z -second/input:0 - - -Z -third_input - - -b -path/to/output:0 - - -b -path/to/output:1 - - -b -path/to/output:2 - - -B
\ No newline at end of file diff --git a/config-model/src/test/integration/onnx-model/files/summary_model.onnx b/config-model/src/test/integration/onnx-model/files/summary_model.onnx deleted file mode 100644 index f3898205c6a..00000000000 --- a/config-model/src/test/integration/onnx-model/files/summary_model.onnx +++ /dev/null @@ -1,34 +0,0 @@ -create_model.py:í -4 -first_input -second/input:0path/to/output:0"Add -4 -third_input -second/input:0path/to/output:1"Add -; -path/to/output:0 -path/to/output:1path/to/output:2"Addsimple_scoringZ -first_input - - -Z -second/input:0 - - -Z -third_input - - -b -path/to/output:0 - - -b -path/to/output:1 - - -b -path/to/output:2 - - -B
\ No newline at end of file diff --git a/config-model/src/test/integration/onnx-model/files/unbound_model.onnx b/config-model/src/test/integration/onnx-model/files/unbound_model.onnx deleted file mode 100644 index 155b3125256..00000000000 --- a/config-model/src/test/integration/onnx-model/files/unbound_model.onnx +++ /dev/null @@ -1,11 +0,0 @@ -create_unbound_model.py:p - -inputoutput"Identitysimple_scoringZ -input - -ÿÿÿÿÿÿÿÿÿ -b! -output - -ÿÿÿÿÿÿÿÿÿ -B
\ No newline at end of file diff --git a/config-model/src/test/integration/onnx-model/searchdefinitions/test.sd b/config-model/src/test/integration/onnx-model/searchdefinitions/test.sd index a87222e77ee..0f0fa694e6f 100644 --- a/config-model/src/test/integration/onnx-model/searchdefinitions/test.sd +++ b/config-model/src/test/integration/onnx-model/searchdefinitions/test.sd @@ -14,7 +14,7 @@ search test { } onnx-model my_model { - file: files/model.onnx + file: files/ranking_model.onnx input first_input: attribute(document_field) input "second/input:0": constant(my_constant) input "third_input": my_function @@ -22,31 +22,19 @@ search test { } onnx-model another_model { - file: files/model.onnx + file: files/ranking_model.onnx input first_input: attribute(document_field) input "second/input:0": constant(my_constant) input "third_input": another_function output "path/to/output:2": out } - onnx-model dynamic_model { - file: files/dynamic_model.onnx - input input: my_function - output output: my_output - } - - onnx-model unbound_model { - file: files/unbound_model.onnx - input input: my_function - output output: my_output - } - rank-profile test_model_config { function my_function() { expression: tensor(d0[2])(1) } first-phase { - expression: onnxModel(my_model).out{d0:1} + expression: onnxModel(my_model).out } } @@ -61,7 +49,7 @@ search test { expression: my_function() } first-phase { - expression: onnxModel("files/model.onnx", "path/to/output:1"){d0:1} + expression: onnxModel("files/ranking_model.onnx", "path/to/output:1") } } @@ -74,39 +62,9 @@ search test { } summary-features { onnxModel(another_model).out - onnxModel("files/summary_model.onnx", "path/to/output:2") + onnxModel("files/ranking_model.onnx", "path/to/output:2") } - } - rank-profile test_dynamic_model { - function my_function() { - expression: tensor(d0[1],d1[2])(d1) - } - first-phase { - expression: onnxModel(dynamic_model){d0:0,d1:1} - } } - rank-profile test_dynamic_model_2 { - function my_function_2() { - expression: tensor(d0[1],d1[3])(d1) - } - function my_function() { - expression: my_function_2() - } - first-phase { - expression: onnxModel(dynamic_model){d0:0,d1:2} - } - } - - rank-profile test_unbound_model { - function my_function() { - expression: tensor(d0[1],d1[2])(d1) - } - first-phase { - expression: onnxModel(unbound_model){d0:0,d1:1} - } - } - - } |