1 // clang-format off
2 // Generated file (from: strided_slice.mod.py). Do not edit
3 // Create the model
createTestModel()4 Model createTestModel() {
5 const std::vector<Operand> operands = {
6 {
7 .type = OperandType::TENSOR_FLOAT32,
8 .dimensions = {2, 3},
9 .numberOfConsumers = 1,
10 .scale = 0.0f,
11 .zeroPoint = 0,
12 .lifetime = OperandLifeTime::MODEL_INPUT,
13 .location = {.poolIndex = 0, .offset = 0, .length = 0},
14 },
15 {
16 .type = OperandType::TENSOR_INT32,
17 .dimensions = {2},
18 .numberOfConsumers = 1,
19 .scale = 0.0f,
20 .zeroPoint = 0,
21 .lifetime = OperandLifeTime::CONSTANT_COPY,
22 .location = {.poolIndex = 0, .offset = 0, .length = 8},
23 },
24 {
25 .type = OperandType::TENSOR_INT32,
26 .dimensions = {2},
27 .numberOfConsumers = 1,
28 .scale = 0.0f,
29 .zeroPoint = 0,
30 .lifetime = OperandLifeTime::CONSTANT_COPY,
31 .location = {.poolIndex = 0, .offset = 8, .length = 8},
32 },
33 {
34 .type = OperandType::TENSOR_INT32,
35 .dimensions = {2},
36 .numberOfConsumers = 1,
37 .scale = 0.0f,
38 .zeroPoint = 0,
39 .lifetime = OperandLifeTime::CONSTANT_COPY,
40 .location = {.poolIndex = 0, .offset = 16, .length = 8},
41 },
42 {
43 .type = OperandType::INT32,
44 .dimensions = {},
45 .numberOfConsumers = 1,
46 .scale = 0.0f,
47 .zeroPoint = 0,
48 .lifetime = OperandLifeTime::CONSTANT_COPY,
49 .location = {.poolIndex = 0, .offset = 24, .length = 4},
50 },
51 {
52 .type = OperandType::INT32,
53 .dimensions = {},
54 .numberOfConsumers = 1,
55 .scale = 0.0f,
56 .zeroPoint = 0,
57 .lifetime = OperandLifeTime::CONSTANT_COPY,
58 .location = {.poolIndex = 0, .offset = 28, .length = 4},
59 },
60 {
61 .type = OperandType::INT32,
62 .dimensions = {},
63 .numberOfConsumers = 1,
64 .scale = 0.0f,
65 .zeroPoint = 0,
66 .lifetime = OperandLifeTime::CONSTANT_COPY,
67 .location = {.poolIndex = 0, .offset = 32, .length = 4},
68 },
69 {
70 .type = OperandType::TENSOR_FLOAT32,
71 .dimensions = {1, 2},
72 .numberOfConsumers = 0,
73 .scale = 0.0f,
74 .zeroPoint = 0,
75 .lifetime = OperandLifeTime::MODEL_OUTPUT,
76 .location = {.poolIndex = 0, .offset = 0, .length = 0},
77 }
78 };
79
80 const std::vector<Operation> operations = {
81 {
82 .type = OperationType::STRIDED_SLICE,
83 .inputs = {0, 1, 2, 3, 4, 5, 6},
84 .outputs = {7},
85 }
86 };
87
88 const std::vector<uint32_t> inputIndexes = {0};
89 const std::vector<uint32_t> outputIndexes = {7};
90 std::vector<uint8_t> operandValues = {
91 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
92 };
93 const std::vector<hidl_memory> pools = {};
94
95 return {
96 .operands = operands,
97 .operations = operations,
98 .inputIndexes = inputIndexes,
99 .outputIndexes = outputIndexes,
100 .operandValues = operandValues,
101 .pools = pools,
102 };
103 }
104
is_ignored(int i)105 inline bool is_ignored(int i) {
106 static std::set<int> ignore = {};
107 return ignore.find(i) != ignore.end();
108 }
109
110 // Create the model
createTestModel_dynamic_output_shape()111 Model createTestModel_dynamic_output_shape() {
112 const std::vector<Operand> operands = {
113 {
114 .type = OperandType::TENSOR_FLOAT32,
115 .dimensions = {2, 3},
116 .numberOfConsumers = 1,
117 .scale = 0.0f,
118 .zeroPoint = 0,
119 .lifetime = OperandLifeTime::MODEL_INPUT,
120 .location = {.poolIndex = 0, .offset = 0, .length = 0},
121 },
122 {
123 .type = OperandType::TENSOR_INT32,
124 .dimensions = {2},
125 .numberOfConsumers = 1,
126 .scale = 0.0f,
127 .zeroPoint = 0,
128 .lifetime = OperandLifeTime::CONSTANT_COPY,
129 .location = {.poolIndex = 0, .offset = 0, .length = 8},
130 },
131 {
132 .type = OperandType::TENSOR_INT32,
133 .dimensions = {2},
134 .numberOfConsumers = 1,
135 .scale = 0.0f,
136 .zeroPoint = 0,
137 .lifetime = OperandLifeTime::CONSTANT_COPY,
138 .location = {.poolIndex = 0, .offset = 8, .length = 8},
139 },
140 {
141 .type = OperandType::TENSOR_INT32,
142 .dimensions = {2},
143 .numberOfConsumers = 1,
144 .scale = 0.0f,
145 .zeroPoint = 0,
146 .lifetime = OperandLifeTime::CONSTANT_COPY,
147 .location = {.poolIndex = 0, .offset = 16, .length = 8},
148 },
149 {
150 .type = OperandType::INT32,
151 .dimensions = {},
152 .numberOfConsumers = 1,
153 .scale = 0.0f,
154 .zeroPoint = 0,
155 .lifetime = OperandLifeTime::CONSTANT_COPY,
156 .location = {.poolIndex = 0, .offset = 24, .length = 4},
157 },
158 {
159 .type = OperandType::INT32,
160 .dimensions = {},
161 .numberOfConsumers = 1,
162 .scale = 0.0f,
163 .zeroPoint = 0,
164 .lifetime = OperandLifeTime::CONSTANT_COPY,
165 .location = {.poolIndex = 0, .offset = 28, .length = 4},
166 },
167 {
168 .type = OperandType::INT32,
169 .dimensions = {},
170 .numberOfConsumers = 1,
171 .scale = 0.0f,
172 .zeroPoint = 0,
173 .lifetime = OperandLifeTime::CONSTANT_COPY,
174 .location = {.poolIndex = 0, .offset = 32, .length = 4},
175 },
176 {
177 .type = OperandType::TENSOR_FLOAT32,
178 .dimensions = {0, 0},
179 .numberOfConsumers = 0,
180 .scale = 0.0f,
181 .zeroPoint = 0,
182 .lifetime = OperandLifeTime::MODEL_OUTPUT,
183 .location = {.poolIndex = 0, .offset = 0, .length = 0},
184 }
185 };
186
187 const std::vector<Operation> operations = {
188 {
189 .type = OperationType::STRIDED_SLICE,
190 .inputs = {0, 1, 2, 3, 4, 5, 6},
191 .outputs = {7},
192 }
193 };
194
195 const std::vector<uint32_t> inputIndexes = {0};
196 const std::vector<uint32_t> outputIndexes = {7};
197 std::vector<uint8_t> operandValues = {
198 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
199 };
200 const std::vector<hidl_memory> pools = {};
201
202 return {
203 .operands = operands,
204 .operations = operations,
205 .inputIndexes = inputIndexes,
206 .outputIndexes = outputIndexes,
207 .operandValues = operandValues,
208 .pools = pools,
209 };
210 }
211
is_ignored_dynamic_output_shape(int i)212 inline bool is_ignored_dynamic_output_shape(int i) {
213 static std::set<int> ignore = {};
214 return ignore.find(i) != ignore.end();
215 }
216
217