• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Generated from sub.mod.py
2 // DO NOT EDIT
3 // clang-format off
4 #include "TestHarness.h"
5 using namespace test_helper;
6 
7 namespace generated_tests::sub {
8 
get_test_model()9 const TestModel& get_test_model() {
10     static TestModel model = {
11         .expectFailure = false,
12         .expectedMultinomialDistributionTolerance = 0,
13         .isRelaxed = false,
14         .main = {
15                 .inputIndexes = {0, 1},
16                 .operands = {{ // op1
17                             .channelQuant = {},
18                             .data = TestBuffer::createFromVector<float>({2.0f, -4.0f, 8.0f, -16.0f}),
19                             .dimensions = {1, 2, 2, 1},
20                             .isIgnored = false,
21                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
22                             .numberOfConsumers = 1,
23                             .scale = 0.0f,
24                             .type = TestOperandType::TENSOR_FLOAT32,
25                             .zeroPoint = 0
26                         }, { // op2
27                             .channelQuant = {},
28                             .data = TestBuffer::createFromVector<float>({2.0f, -2.0f, -4.0f, 4.0f}),
29                             .dimensions = {1, 2, 2, 1},
30                             .isIgnored = false,
31                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
32                             .numberOfConsumers = 1,
33                             .scale = 0.0f,
34                             .type = TestOperandType::TENSOR_FLOAT32,
35                             .zeroPoint = 0
36                         }, { // act
37                             .channelQuant = {},
38                             .data = TestBuffer::createFromVector<int32_t>({0}),
39                             .dimensions = {},
40                             .isIgnored = false,
41                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
42                             .numberOfConsumers = 1,
43                             .scale = 0.0f,
44                             .type = TestOperandType::INT32,
45                             .zeroPoint = 0
46                         }, { // op3
47                             .channelQuant = {},
48                             .data = TestBuffer::createFromVector<float>({0.0f, -2.0f, 12.0f, -20.0f}),
49                             .dimensions = {1, 2, 2, 1},
50                             .isIgnored = false,
51                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
52                             .numberOfConsumers = 0,
53                             .scale = 0.0f,
54                             .type = TestOperandType::TENSOR_FLOAT32,
55                             .zeroPoint = 0
56                         }},
57                 .operations = {{
58                             .inputs = {0, 1, 2},
59                             .outputs = {3},
60                             .type = TestOperationType::SUB
61                         }},
62                 .outputIndexes = {3}
63             },
64         .minSupportedVersion = TestHalVersion::V1_1,
65         .referenced = {}
66     };
67     return model;
68 }
69 
70 const auto dummy_test_model = TestModelManager::get().add("sub", get_test_model());
71 
72 }  // namespace generated_tests::sub
73 
74 namespace generated_tests::sub {
75 
get_test_model_all_inputs_as_internal()76 const TestModel& get_test_model_all_inputs_as_internal() {
77     static TestModel model = {
78         .expectFailure = false,
79         .expectedMultinomialDistributionTolerance = 0,
80         .isRelaxed = false,
81         .main = {
82                 .inputIndexes = {4, 7},
83                 .operands = {{ // op1
84                             .channelQuant = {},
85                             .data = TestBuffer::createFromVector<float>({}),
86                             .dimensions = {1, 2, 2, 1},
87                             .isIgnored = false,
88                             .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
89                             .numberOfConsumers = 1,
90                             .scale = 0.0f,
91                             .type = TestOperandType::TENSOR_FLOAT32,
92                             .zeroPoint = 0
93                         }, { // op2
94                             .channelQuant = {},
95                             .data = TestBuffer::createFromVector<float>({}),
96                             .dimensions = {1, 2, 2, 1},
97                             .isIgnored = false,
98                             .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
99                             .numberOfConsumers = 1,
100                             .scale = 0.0f,
101                             .type = TestOperandType::TENSOR_FLOAT32,
102                             .zeroPoint = 0
103                         }, { // act
104                             .channelQuant = {},
105                             .data = TestBuffer::createFromVector<int32_t>({0}),
106                             .dimensions = {},
107                             .isIgnored = false,
108                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
109                             .numberOfConsumers = 1,
110                             .scale = 0.0f,
111                             .type = TestOperandType::INT32,
112                             .zeroPoint = 0
113                         }, { // op3
114                             .channelQuant = {},
115                             .data = TestBuffer::createFromVector<float>({0.0f, -2.0f, 12.0f, -20.0f}),
116                             .dimensions = {1, 2, 2, 1},
117                             .isIgnored = false,
118                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
119                             .numberOfConsumers = 0,
120                             .scale = 0.0f,
121                             .type = TestOperandType::TENSOR_FLOAT32,
122                             .zeroPoint = 0
123                         }, { // op1_new
124                             .channelQuant = {},
125                             .data = TestBuffer::createFromVector<float>({2.0f, -4.0f, 8.0f, -16.0f}),
126                             .dimensions = {1, 2, 2, 1},
127                             .isIgnored = false,
128                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
129                             .numberOfConsumers = 1,
130                             .scale = 0.0f,
131                             .type = TestOperandType::TENSOR_FLOAT32,
132                             .zeroPoint = 0
133                         }, { // placeholder
134                             .channelQuant = {},
135                             .data = TestBuffer::createFromVector<float>({0.0f}),
136                             .dimensions = {1},
137                             .isIgnored = false,
138                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
139                             .numberOfConsumers = 1,
140                             .scale = 0.0f,
141                             .type = TestOperandType::TENSOR_FLOAT32,
142                             .zeroPoint = 0
143                         }, { // param
144                             .channelQuant = {},
145                             .data = TestBuffer::createFromVector<int32_t>({0}),
146                             .dimensions = {},
147                             .isIgnored = false,
148                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
149                             .numberOfConsumers = 1,
150                             .scale = 0.0f,
151                             .type = TestOperandType::INT32,
152                             .zeroPoint = 0
153                         }, { // op2_new
154                             .channelQuant = {},
155                             .data = TestBuffer::createFromVector<float>({2.0f, -2.0f, -4.0f, 4.0f}),
156                             .dimensions = {1, 2, 2, 1},
157                             .isIgnored = false,
158                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
159                             .numberOfConsumers = 1,
160                             .scale = 0.0f,
161                             .type = TestOperandType::TENSOR_FLOAT32,
162                             .zeroPoint = 0
163                         }, { // placeholder1
164                             .channelQuant = {},
165                             .data = TestBuffer::createFromVector<float>({0.0f}),
166                             .dimensions = {1},
167                             .isIgnored = false,
168                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
169                             .numberOfConsumers = 1,
170                             .scale = 0.0f,
171                             .type = TestOperandType::TENSOR_FLOAT32,
172                             .zeroPoint = 0
173                         }, { // param1
174                             .channelQuant = {},
175                             .data = TestBuffer::createFromVector<int32_t>({0}),
176                             .dimensions = {},
177                             .isIgnored = false,
178                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
179                             .numberOfConsumers = 1,
180                             .scale = 0.0f,
181                             .type = TestOperandType::INT32,
182                             .zeroPoint = 0
183                         }},
184                 .operations = {{
185                             .inputs = {4, 5, 6},
186                             .outputs = {0},
187                             .type = TestOperationType::ADD
188                         }, {
189                             .inputs = {7, 8, 9},
190                             .outputs = {1},
191                             .type = TestOperationType::ADD
192                         }, {
193                             .inputs = {0, 1, 2},
194                             .outputs = {3},
195                             .type = TestOperationType::SUB
196                         }},
197                 .outputIndexes = {3}
198             },
199         .minSupportedVersion = TestHalVersion::V1_1,
200         .referenced = {}
201     };
202     return model;
203 }
204 
205 const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add("sub_all_inputs_as_internal", get_test_model_all_inputs_as_internal());
206 
207 }  // namespace generated_tests::sub
208 
209