1 // Generated from sub.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::sub {
8 
get_test_model()9 const TestModel& get_test_model() {
10     static TestModel model = {
11         .main = {
12                 .operands = {{ // op1
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>({2.0f, -4.0f, 8.0f, -16.0f})
22                         }, { // op2
23                             .type = TestOperandType::TENSOR_FLOAT32,
24                             .dimensions = {1, 2, 2, 1},
25                             .numberOfConsumers = 1,
26                             .scale = 0.0f,
27                             .zeroPoint = 0,
28                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
29                             .channelQuant = {},
30                             .isIgnored = false,
31                             .data = TestBuffer::createFromVector<float>({2.0f, -2.0f, -4.0f, 4.0f})
32                         }, { // act
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                         }, { // op3
43                             .type = TestOperandType::TENSOR_FLOAT32,
44                             .dimensions = {1, 2, 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>({0.0f, -2.0f, 12.0f, -20.0f})
52                         }},
53                 .operations = {{
54                             .type = TestOperationType::SUB,
55                             .inputs = {0, 1, 2},
56                             .outputs = {3}
57                         }},
58                 .inputIndexes = {0, 1},
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("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         .main = {
79                 .operands = {{ // op1
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                         }, { // op2
90                             .type = TestOperandType::TENSOR_FLOAT32,
91                             .dimensions = {1, 2, 2, 1},
92                             .numberOfConsumers = 1,
93                             .scale = 0.0f,
94                             .zeroPoint = 0,
95                             .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
96                             .channelQuant = {},
97                             .isIgnored = false,
98                             .data = TestBuffer::createFromVector<float>({})
99                         }, { // act
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                         }, { // op3
110                             .type = TestOperandType::TENSOR_FLOAT32,
111                             .dimensions = {1, 2, 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>({0.0f, -2.0f, 12.0f, -20.0f})
119                         }, { // op1_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>({2.0f, -4.0f, 8.0f, -16.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                         }, { // op2_new
150                             .type = TestOperandType::TENSOR_FLOAT32,
151                             .dimensions = {1, 2, 2, 1},
152                             .numberOfConsumers = 1,
153                             .scale = 0.0f,
154                             .zeroPoint = 0,
155                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
156                             .channelQuant = {},
157                             .isIgnored = false,
158                             .data = TestBuffer::createFromVector<float>({2.0f, -2.0f, -4.0f, 4.0f})
159                         }, { // placeholder1
160                             .type = TestOperandType::TENSOR_FLOAT32,
161                             .dimensions = {1},
162                             .numberOfConsumers = 1,
163                             .scale = 0.0f,
164                             .zeroPoint = 0,
165                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
166                             .channelQuant = {},
167                             .isIgnored = false,
168                             .data = TestBuffer::createFromVector<float>({0.0f})
169                         }, { // param1
170                             .type = TestOperandType::INT32,
171                             .dimensions = {},
172                             .numberOfConsumers = 1,
173                             .scale = 0.0f,
174                             .zeroPoint = 0,
175                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
176                             .channelQuant = {},
177                             .isIgnored = false,
178                             .data = TestBuffer::createFromVector<int32_t>({0})
179                         }},
180                 .operations = {{
181                             .type = TestOperationType::ADD,
182                             .inputs = {4, 5, 6},
183                             .outputs = {0}
184                         }, {
185                             .type = TestOperationType::ADD,
186                             .inputs = {7, 8, 9},
187                             .outputs = {1}
188                         }, {
189                             .type = TestOperationType::SUB,
190                             .inputs = {0, 1, 2},
191                             .outputs = {3}
192                         }},
193                 .inputIndexes = {4, 7},
194                 .outputIndexes = {3}
195             },
196         .referenced = {},
197         .isRelaxed = false,
198         .expectedMultinomialDistributionTolerance = 0,
199         .expectFailure = false,
200         .minSupportedVersion = TestHalVersion::V1_1
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