summaryrefslogtreecommitdiffstats
path: root/config-model/src/test/integration/onnx-model
diff options
context:
space:
mode:
Diffstat (limited to 'config-model/src/test/integration/onnx-model')
-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.xml17
3 files changed, 93 insertions, 0 deletions
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-model/services.xml b/config-model/src/test/integration/onnx-model/services.xml
new file mode 100644
index 00000000000..892ce9a9f89
--- /dev/null
+++ b/config-model/src/test/integration/onnx-model/services.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!-- Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
+<services>
+ <admin version="2.0">
+ <adminserver hostalias="node1" />
+ <logserver hostalias="node1" />
+ </admin>
+ <content id="test" version="1.0">
+ <redundancy>1</redundancy>
+ <documents>
+ <document type='test' mode="index"/>
+ </documents>
+ <nodes>
+ <node hostalias='node1' distribution-key='0'/>
+ </nodes>
+ </content>
+</services>