summaryrefslogtreecommitdiffstats
path: root/config-model/src/test/integration
diff options
context:
space:
mode:
authorLester Solbakken <lesters@oath.com>2020-10-25 22:04:16 +0100
committerLester Solbakken <lesters@oath.com>2020-10-25 22:04:16 +0100
commit239f2137a05709a83163a8cae68bc04d5b0a27e8 (patch)
tree0cc9b306024b51b4ca18e721877179afc99b1cdc /config-model/src/test/integration
parent38e2a6a325db457456e04ce8385f23b12a5da54d (diff)
Properly handle ONNX dimensions of size -1
Diffstat (limited to 'config-model/src/test/integration')
-rwxr-xr-xconfig-model/src/test/integration/onnx-model/files/create_unbound_model.py12
-rw-r--r--config-model/src/test/integration/onnx-model/files/unbound_model.onnx11
-rw-r--r--config-model/src/test/integration/onnx-model/searchdefinitions/test.sd16
3 files changed, 39 insertions, 0 deletions
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
new file mode 100755
index 00000000000..abf733ea43f
--- /dev/null
+++ b/config-model/src/test/integration/onnx-model/files/create_unbound_model.py
@@ -0,0 +1,12 @@
+# 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/unbound_model.onnx b/config-model/src/test/integration/onnx-model/files/unbound_model.onnx
new file mode 100644
index 00000000000..155b3125256
--- /dev/null
+++ b/config-model/src/test/integration/onnx-model/files/unbound_model.onnx
@@ -0,0 +1,11 @@
+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 6e9ba356293..a87222e77ee 100644
--- a/config-model/src/test/integration/onnx-model/searchdefinitions/test.sd
+++ b/config-model/src/test/integration/onnx-model/searchdefinitions/test.sd
@@ -35,6 +35,12 @@ search test {
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)
@@ -93,4 +99,14 @@ search test {
}
}
+ 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}
+ }
+ }
+
+
}