1 // Generated from mean.mod.py
2 // DO NOT EDIT
3 // clang-format off
4 #include "TestHarness.h"
5 using namespace test_helper;  // NOLINT(google-build-using-namespace)
6 
7 namespace generated_tests::mean {
8 
get_test_model()9 const TestModel& get_test_model() {
10     static TestModel model = {
11         .main = {
12                 .operands = {{ // input
13                             .type = TestOperandType::TENSOR_FLOAT32,
14                             .dimensions = {1, 2, 2, 1},
15                             .numberOfConsumers = 1,
16                             .scale = 0.0f,
17                             .zeroPoint = 0,
18                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
19                             .channelQuant = {},
20                             .isIgnored = false,
21                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f})
22                         }, { // axis
23                             .type = TestOperandType::TENSOR_INT32,
24                             .dimensions = {1},
25                             .numberOfConsumers = 1,
26                             .scale = 0.0f,
27                             .zeroPoint = 0,
28                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
29                             .channelQuant = {},
30                             .isIgnored = false,
31                             .data = TestBuffer::createFromVector<int32_t>({2})
32                         }, { // keepDims
33                             .type = TestOperandType::INT32,
34                             .dimensions = {},
35                             .numberOfConsumers = 1,
36                             .scale = 0.0f,
37                             .zeroPoint = 0,
38                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
39                             .channelQuant = {},
40                             .isIgnored = false,
41                             .data = TestBuffer::createFromVector<int32_t>({0})
42                         }, { // output
43                             .type = TestOperandType::TENSOR_FLOAT32,
44                             .dimensions = {1, 2, 1},
45                             .numberOfConsumers = 0,
46                             .scale = 0.0f,
47                             .zeroPoint = 0,
48                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
49                             .channelQuant = {},
50                             .isIgnored = false,
51                             .data = TestBuffer::createFromVector<float>({1.5f, 3.5f})
52                         }},
53                 .operations = {{
54                             .type = TestOperationType::MEAN,
55                             .inputs = {0, 1, 2},
56                             .outputs = {3}
57                         }},
58                 .inputIndexes = {0},
59                 .outputIndexes = {3}
60             },
61         .referenced = {},
62         .isRelaxed = false,
63         .expectedMultinomialDistributionTolerance = 0,
64         .expectFailure = false,
65         .minSupportedVersion = TestHalVersion::V1_1
66     };
67     return model;
68 }
69 
70 const auto dummy_test_model = TestModelManager::get().add("mean", get_test_model());
71 
72 }  // namespace generated_tests::mean
73 
74 namespace generated_tests::mean {
75 
get_test_model_all_inputs_as_internal()76 const TestModel& get_test_model_all_inputs_as_internal() {
77     static TestModel model = {
78         .main = {
79                 .operands = {{ // input
80                             .type = TestOperandType::TENSOR_FLOAT32,
81                             .dimensions = {1, 2, 2, 1},
82                             .numberOfConsumers = 1,
83                             .scale = 0.0f,
84                             .zeroPoint = 0,
85                             .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
86                             .channelQuant = {},
87                             .isIgnored = false,
88                             .data = TestBuffer::createFromVector<float>({})
89                         }, { // axis
90                             .type = TestOperandType::TENSOR_INT32,
91                             .dimensions = {1},
92                             .numberOfConsumers = 1,
93                             .scale = 0.0f,
94                             .zeroPoint = 0,
95                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
96                             .channelQuant = {},
97                             .isIgnored = false,
98                             .data = TestBuffer::createFromVector<int32_t>({2})
99                         }, { // keepDims
100                             .type = TestOperandType::INT32,
101                             .dimensions = {},
102                             .numberOfConsumers = 1,
103                             .scale = 0.0f,
104                             .zeroPoint = 0,
105                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
106                             .channelQuant = {},
107                             .isIgnored = false,
108                             .data = TestBuffer::createFromVector<int32_t>({0})
109                         }, { // output
110                             .type = TestOperandType::TENSOR_FLOAT32,
111                             .dimensions = {1, 2, 1},
112                             .numberOfConsumers = 0,
113                             .scale = 0.0f,
114                             .zeroPoint = 0,
115                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
116                             .channelQuant = {},
117                             .isIgnored = false,
118                             .data = TestBuffer::createFromVector<float>({1.5f, 3.5f})
119                         }, { // input_new
120                             .type = TestOperandType::TENSOR_FLOAT32,
121                             .dimensions = {1, 2, 2, 1},
122                             .numberOfConsumers = 1,
123                             .scale = 0.0f,
124                             .zeroPoint = 0,
125                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
126                             .channelQuant = {},
127                             .isIgnored = false,
128                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f})
129                         }, { // placeholder
130                             .type = TestOperandType::TENSOR_FLOAT32,
131                             .dimensions = {1},
132                             .numberOfConsumers = 1,
133                             .scale = 0.0f,
134                             .zeroPoint = 0,
135                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
136                             .channelQuant = {},
137                             .isIgnored = false,
138                             .data = TestBuffer::createFromVector<float>({0.0f})
139                         }, { // param
140                             .type = TestOperandType::INT32,
141                             .dimensions = {},
142                             .numberOfConsumers = 1,
143                             .scale = 0.0f,
144                             .zeroPoint = 0,
145                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
146                             .channelQuant = {},
147                             .isIgnored = false,
148                             .data = TestBuffer::createFromVector<int32_t>({0})
149                         }},
150                 .operations = {{
151                             .type = TestOperationType::ADD,
152                             .inputs = {4, 5, 6},
153                             .outputs = {0}
154                         }, {
155                             .type = TestOperationType::MEAN,
156                             .inputs = {0, 1, 2},
157                             .outputs = {3}
158                         }},
159                 .inputIndexes = {4},
160                 .outputIndexes = {3}
161             },
162         .referenced = {},
163         .isRelaxed = false,
164         .expectedMultinomialDistributionTolerance = 0,
165         .expectFailure = false,
166         .minSupportedVersion = TestHalVersion::V1_1
167     };
168     return model;
169 }
170 
171 const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add("mean_all_inputs_as_internal", get_test_model_all_inputs_as_internal());
172 
173 }  // namespace generated_tests::mean
174 
175 namespace generated_tests::mean {
176 
get_test_model_all_tensors_as_inputs()177 const TestModel& get_test_model_all_tensors_as_inputs() {
178     static TestModel model = {
179         .main = {
180                 .operands = {{ // input
181                             .type = TestOperandType::TENSOR_FLOAT32,
182                             .dimensions = {1, 2, 2, 1},
183                             .numberOfConsumers = 1,
184                             .scale = 0.0f,
185                             .zeroPoint = 0,
186                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
187                             .channelQuant = {},
188                             .isIgnored = false,
189                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f})
190                         }, { // axis
191                             .type = TestOperandType::TENSOR_INT32,
192                             .dimensions = {1},
193                             .numberOfConsumers = 1,
194                             .scale = 0.0f,
195                             .zeroPoint = 0,
196                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
197                             .channelQuant = {},
198                             .isIgnored = false,
199                             .data = TestBuffer::createFromVector<int32_t>({2})
200                         }, { // keepDims
201                             .type = TestOperandType::INT32,
202                             .dimensions = {},
203                             .numberOfConsumers = 1,
204                             .scale = 0.0f,
205                             .zeroPoint = 0,
206                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
207                             .channelQuant = {},
208                             .isIgnored = false,
209                             .data = TestBuffer::createFromVector<int32_t>({0})
210                         }, { // output
211                             .type = TestOperandType::TENSOR_FLOAT32,
212                             .dimensions = {1, 2, 1},
213                             .numberOfConsumers = 0,
214                             .scale = 0.0f,
215                             .zeroPoint = 0,
216                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
217                             .channelQuant = {},
218                             .isIgnored = false,
219                             .data = TestBuffer::createFromVector<float>({1.5f, 3.5f})
220                         }},
221                 .operations = {{
222                             .type = TestOperationType::MEAN,
223                             .inputs = {0, 1, 2},
224                             .outputs = {3}
225                         }},
226                 .inputIndexes = {0, 1},
227                 .outputIndexes = {3}
228             },
229         .referenced = {},
230         .isRelaxed = false,
231         .expectedMultinomialDistributionTolerance = 0,
232         .expectFailure = false,
233         .minSupportedVersion = TestHalVersion::V1_1
234     };
235     return model;
236 }
237 
238 const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("mean_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs());
239 
240 }  // namespace generated_tests::mean
241 
242 namespace generated_tests::mean {
243 
get_test_model_all_tensors_as_inputs_all_inputs_as_internal()244 const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() {
245     static TestModel model = {
246         .main = {
247                 .operands = {{ // input
248                             .type = TestOperandType::TENSOR_FLOAT32,
249                             .dimensions = {1, 2, 2, 1},
250                             .numberOfConsumers = 1,
251                             .scale = 0.0f,
252                             .zeroPoint = 0,
253                             .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
254                             .channelQuant = {},
255                             .isIgnored = false,
256                             .data = TestBuffer::createFromVector<float>({})
257                         }, { // axis
258                             .type = TestOperandType::TENSOR_INT32,
259                             .dimensions = {1},
260                             .numberOfConsumers = 1,
261                             .scale = 0.0f,
262                             .zeroPoint = 0,
263                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
264                             .channelQuant = {},
265                             .isIgnored = false,
266                             .data = TestBuffer::createFromVector<int32_t>({2})
267                         }, { // keepDims
268                             .type = TestOperandType::INT32,
269                             .dimensions = {},
270                             .numberOfConsumers = 1,
271                             .scale = 0.0f,
272                             .zeroPoint = 0,
273                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
274                             .channelQuant = {},
275                             .isIgnored = false,
276                             .data = TestBuffer::createFromVector<int32_t>({0})
277                         }, { // output
278                             .type = TestOperandType::TENSOR_FLOAT32,
279                             .dimensions = {1, 2, 1},
280                             .numberOfConsumers = 0,
281                             .scale = 0.0f,
282                             .zeroPoint = 0,
283                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
284                             .channelQuant = {},
285                             .isIgnored = false,
286                             .data = TestBuffer::createFromVector<float>({1.5f, 3.5f})
287                         }, { // input_new
288                             .type = TestOperandType::TENSOR_FLOAT32,
289                             .dimensions = {1, 2, 2, 1},
290                             .numberOfConsumers = 1,
291                             .scale = 0.0f,
292                             .zeroPoint = 0,
293                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
294                             .channelQuant = {},
295                             .isIgnored = false,
296                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f})
297                         }, { // placeholder1
298                             .type = TestOperandType::TENSOR_FLOAT32,
299                             .dimensions = {1},
300                             .numberOfConsumers = 1,
301                             .scale = 0.0f,
302                             .zeroPoint = 0,
303                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
304                             .channelQuant = {},
305                             .isIgnored = false,
306                             .data = TestBuffer::createFromVector<float>({0.0f})
307                         }, { // param1
308                             .type = TestOperandType::INT32,
309                             .dimensions = {},
310                             .numberOfConsumers = 1,
311                             .scale = 0.0f,
312                             .zeroPoint = 0,
313                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
314                             .channelQuant = {},
315                             .isIgnored = false,
316                             .data = TestBuffer::createFromVector<int32_t>({0})
317                         }},
318                 .operations = {{
319                             .type = TestOperationType::ADD,
320                             .inputs = {4, 5, 6},
321                             .outputs = {0}
322                         }, {
323                             .type = TestOperationType::MEAN,
324                             .inputs = {0, 1, 2},
325                             .outputs = {3}
326                         }},
327                 .inputIndexes = {1, 4},
328                 .outputIndexes = {3}
329             },
330         .referenced = {},
331         .isRelaxed = false,
332         .expectedMultinomialDistributionTolerance = 0,
333         .expectFailure = false,
334         .minSupportedVersion = TestHalVersion::V1_1
335     };
336     return model;
337 }
338 
339 const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("mean_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal());
340 
341 }  // namespace generated_tests::mean
342 
343