summaryrefslogtreecommitdiffstats
path: root/config-model/src/test/integration/onnx-model/searchdefinitions/test.sd
blob: 6e9ba3562931cbaa376ef1264703f0210a57d53b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# 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/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/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
    }

    rank-profile test_model_config {
        function my_function() {
            expression: tensor(d0[2])(1)
        }
        first-phase {
            expression: onnxModel(my_model).out{d0:1}
        }
    }

    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/model.onnx", "path/to/output:1"){d0: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/summary_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}
        }
    }

}