summaryrefslogtreecommitdiffstats
path: root/config-model/src/test/integration
diff options
context:
space:
mode:
authorLester Solbakken <lesters@oath.com>2020-09-18 14:58:57 +0200
committerLester Solbakken <lesters@oath.com>2020-09-18 14:58:57 +0200
commitbe544696d4b70ee186dc80f250bda7d99cd0e20f (patch)
treee200be1130b49b2d626f00a681eec84b4686ab05 /config-model/src/test/integration
parentbf3ca4359b94aff539fc79b80b4caac66225a028 (diff)
Add explicit config for onnx models
Diffstat (limited to 'config-model/src/test/integration')
-rw-r--r--config-model/src/test/integration/onnx-file/files/simple.onnx23
-rw-r--r--config-model/src/test/integration/onnx-file/searchdefinitions/test.sd11
-rw-r--r--config-model/src/test/integration/onnx-model/files/constant.json6
-rw-r--r--config-model/src/test/integration/onnx-model/searchdefinitions/test.sd70
-rw-r--r--config-model/src/test/integration/onnx-model/services.xml (renamed from config-model/src/test/integration/onnx-file/services.xml)0
5 files changed, 76 insertions, 34 deletions
diff --git a/config-model/src/test/integration/onnx-file/files/simple.onnx b/config-model/src/test/integration/onnx-file/files/simple.onnx
deleted file mode 100644
index eaa66f533da..00000000000
--- a/config-model/src/test/integration/onnx-file/files/simple.onnx
+++ /dev/null
@@ -1,23 +0,0 @@
- simple.py:ß
-0
- query_tensor
-attribute_tensormatmul"MatMul
-"
-matmul
- bias_tensoroutput"Addsimple_scoringZ
- query_tensor
- 
-
-Z"
-attribute_tensor
- 
-
-Z
- bias_tensor
-
-
-b
-output
- 
-
-B \ No newline at end of file
diff --git a/config-model/src/test/integration/onnx-file/searchdefinitions/test.sd b/config-model/src/test/integration/onnx-file/searchdefinitions/test.sd
deleted file mode 100644
index 5ca0cd1b8bf..00000000000
--- a/config-model/src/test/integration/onnx-file/searchdefinitions/test.sd
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-search test {
- document test {}
-
- rank-profile my_profile inherits default {
- first-phase {
- expression: onnxModel("files/simple.onnx", "output")
- }
- }
-
-}
diff --git a/config-model/src/test/integration/onnx-model/files/constant.json b/config-model/src/test/integration/onnx-model/files/constant.json
new file mode 100644
index 00000000000..63f64a73af5
--- /dev/null
+++ b/config-model/src/test/integration/onnx-model/files/constant.json
@@ -0,0 +1,6 @@
+{
+ "cells": [
+ { "address": { "d0": "0" }, "value": 2.0 },
+ { "address": { "d0": "1" }, "value": 3.0 }
+ ]
+} \ 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
new file mode 100644
index 00000000000..0f0fa694e6f
--- /dev/null
+++ b/config-model/src/test/integration/onnx-model/searchdefinitions/test.sd
@@ -0,0 +1,70 @@
+# Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+
+search test {
+
+ document test {
+ field document_field type tensor(d0[2]) {
+ indexing: attribute
+ }
+ }
+
+ constant my_constant {
+ file: files/constant.json
+ type: tensor(d0[2])
+ }
+
+ onnx-model my_model {
+ file: files/ranking_model.onnx
+ input first_input: attribute(document_field)
+ input "second/input:0": constant(my_constant)
+ input "third_input": my_function
+ output "path/to/output:0": out
+ }
+
+ onnx-model another_model {
+ 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
+ }
+
+ rank-profile test_model_config {
+ function my_function() {
+ expression: tensor(d0[2])(1)
+ }
+ first-phase {
+ expression: onnxModel(my_model).out
+ }
+ }
+
+ rank-profile test_generated_model_config inherits test_model_config {
+ function first_input() {
+ expression: attribute(document_field)
+ }
+ function second_input() {
+ expression: constant(my_constant)
+ }
+ function third_input() {
+ expression: my_function()
+ }
+ first-phase {
+ expression: onnxModel("files/ranking_model.onnx", "path/to/output:1")
+ }
+ }
+
+ rank-profile test_summary_features {
+ function another_function() {
+ expression: tensor(d0[2])(2)
+ }
+ first-phase {
+ expression: 1
+ }
+ summary-features {
+ onnxModel(another_model).out
+ onnxModel("files/ranking_model.onnx", "path/to/output:2")
+ }
+
+ }
+
+}
diff --git a/config-model/src/test/integration/onnx-file/services.xml b/config-model/src/test/integration/onnx-model/services.xml
index 892ce9a9f89..892ce9a9f89 100644
--- a/config-model/src/test/integration/onnx-file/services.xml
+++ b/config-model/src/test/integration/onnx-model/services.xml