• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // clang-format off
2 // Generated file (from: conv_float.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 = {1, 3, 3, 1},
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_FLOAT32,
17             .dimensions = {1, 2, 2, 1},
18             .numberOfConsumers = 1,
19             .scale = 0.0f,
20             .zeroPoint = 0,
21             .lifetime = OperandLifeTime::CONSTANT_COPY,
22             .location = {.poolIndex = 0, .offset = 0, .length = 16},
23         },
24         {
25             .type = OperandType::TENSOR_FLOAT32,
26             .dimensions = {1},
27             .numberOfConsumers = 1,
28             .scale = 0.0f,
29             .zeroPoint = 0,
30             .lifetime = OperandLifeTime::CONSTANT_COPY,
31             .location = {.poolIndex = 0, .offset = 16, .length = 4},
32         },
33         {
34             .type = OperandType::INT32,
35             .dimensions = {},
36             .numberOfConsumers = 4,
37             .scale = 0.0f,
38             .zeroPoint = 0,
39             .lifetime = OperandLifeTime::CONSTANT_COPY,
40             .location = {.poolIndex = 0, .offset = 20, .length = 4},
41         },
42         {
43             .type = OperandType::INT32,
44             .dimensions = {},
45             .numberOfConsumers = 2,
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::TENSOR_FLOAT32,
62             .dimensions = {1, 2, 2, 1},
63             .numberOfConsumers = 0,
64             .scale = 0.0f,
65             .zeroPoint = 0,
66             .lifetime = OperandLifeTime::MODEL_OUTPUT,
67             .location = {.poolIndex = 0, .offset = 0, .length = 0},
68         }
69     };
70 
71     const std::vector<Operation> operations = {
72         {
73             .type = OperationType::CONV_2D,
74             .inputs = {0, 1, 2, 3, 3, 3, 3, 4, 4, 5},
75             .outputs = {6},
76         }
77     };
78 
79     const std::vector<uint32_t> inputIndexes = {0};
80     const std::vector<uint32_t> outputIndexes = {6};
81     std::vector<uint8_t> operandValues = {
82       0, 0, 128, 62, 0, 0, 128, 62, 0, 0, 128, 62, 0, 0, 128, 62, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0
83     };
84     const std::vector<hidl_memory> pools = {};
85 
86     return {
87         .operands = operands,
88         .operations = operations,
89         .inputIndexes = inputIndexes,
90         .outputIndexes = outputIndexes,
91         .operandValues = operandValues,
92         .pools = pools,
93     };
94 }
95 
is_ignored(int i)96 inline bool is_ignored(int i) {
97   static std::set<int> ignore = {};
98   return ignore.find(i) != ignore.end();
99 }
100 
101 // Create the model
createTestModel_dynamic_output_shape()102 Model createTestModel_dynamic_output_shape() {
103     const std::vector<Operand> operands = {
104         {
105             .type = OperandType::TENSOR_FLOAT32,
106             .dimensions = {1, 3, 3, 1},
107             .numberOfConsumers = 1,
108             .scale = 0.0f,
109             .zeroPoint = 0,
110             .lifetime = OperandLifeTime::MODEL_INPUT,
111             .location = {.poolIndex = 0, .offset = 0, .length = 0},
112         },
113         {
114             .type = OperandType::TENSOR_FLOAT32,
115             .dimensions = {1, 2, 2, 1},
116             .numberOfConsumers = 1,
117             .scale = 0.0f,
118             .zeroPoint = 0,
119             .lifetime = OperandLifeTime::CONSTANT_COPY,
120             .location = {.poolIndex = 0, .offset = 0, .length = 16},
121         },
122         {
123             .type = OperandType::TENSOR_FLOAT32,
124             .dimensions = {1},
125             .numberOfConsumers = 1,
126             .scale = 0.0f,
127             .zeroPoint = 0,
128             .lifetime = OperandLifeTime::CONSTANT_COPY,
129             .location = {.poolIndex = 0, .offset = 16, .length = 4},
130         },
131         {
132             .type = OperandType::INT32,
133             .dimensions = {},
134             .numberOfConsumers = 4,
135             .scale = 0.0f,
136             .zeroPoint = 0,
137             .lifetime = OperandLifeTime::CONSTANT_COPY,
138             .location = {.poolIndex = 0, .offset = 20, .length = 4},
139         },
140         {
141             .type = OperandType::INT32,
142             .dimensions = {},
143             .numberOfConsumers = 2,
144             .scale = 0.0f,
145             .zeroPoint = 0,
146             .lifetime = OperandLifeTime::CONSTANT_COPY,
147             .location = {.poolIndex = 0, .offset = 24, .length = 4},
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 = 28, .length = 4},
157         },
158         {
159             .type = OperandType::TENSOR_FLOAT32,
160             .dimensions = {0, 0, 0, 0},
161             .numberOfConsumers = 0,
162             .scale = 0.0f,
163             .zeroPoint = 0,
164             .lifetime = OperandLifeTime::MODEL_OUTPUT,
165             .location = {.poolIndex = 0, .offset = 0, .length = 0},
166         }
167     };
168 
169     const std::vector<Operation> operations = {
170         {
171             .type = OperationType::CONV_2D,
172             .inputs = {0, 1, 2, 3, 3, 3, 3, 4, 4, 5},
173             .outputs = {6},
174         }
175     };
176 
177     const std::vector<uint32_t> inputIndexes = {0};
178     const std::vector<uint32_t> outputIndexes = {6};
179     std::vector<uint8_t> operandValues = {
180       0, 0, 128, 62, 0, 0, 128, 62, 0, 0, 128, 62, 0, 0, 128, 62, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0
181     };
182     const std::vector<hidl_memory> pools = {};
183 
184     return {
185         .operands = operands,
186         .operations = operations,
187         .inputIndexes = inputIndexes,
188         .outputIndexes = outputIndexes,
189         .operandValues = operandValues,
190         .pools = pools,
191     };
192 }
193 
is_ignored_dynamic_output_shape(int i)194 inline bool is_ignored_dynamic_output_shape(int i) {
195   static std::set<int> ignore = {};
196   return ignore.find(i) != ignore.end();
197 }
198 
199