1 // Generated code. Do not edit 2 // Create the model 3 Model createTestModel() { 4 const std::vector<Operand> operands = { 5 { 6 .type = OperandType::TENSOR_FLOAT32, 7 .dimensions = {1, 2}, 8 .numberOfConsumers = 1, 9 .scale = 0.0f, 10 .zeroPoint = 0, 11 .lifetime = OperandLifeTime::MODEL_INPUT, 12 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 13 }, 14 { 15 .type = OperandType::TENSOR_FLOAT32, 16 .dimensions = {4, 2}, 17 .numberOfConsumers = 1, 18 .scale = 0.0f, 19 .zeroPoint = 0, 20 .lifetime = OperandLifeTime::MODEL_INPUT, 21 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 22 }, 23 { 24 .type = OperandType::TENSOR_FLOAT32, 25 .dimensions = {4, 2}, 26 .numberOfConsumers = 1, 27 .scale = 0.0f, 28 .zeroPoint = 0, 29 .lifetime = OperandLifeTime::MODEL_INPUT, 30 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 31 }, 32 { 33 .type = OperandType::TENSOR_FLOAT32, 34 .dimensions = {4, 2}, 35 .numberOfConsumers = 1, 36 .scale = 0.0f, 37 .zeroPoint = 0, 38 .lifetime = OperandLifeTime::MODEL_INPUT, 39 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 40 }, 41 { 42 .type = OperandType::TENSOR_FLOAT32, 43 .dimensions = {4, 2}, 44 .numberOfConsumers = 1, 45 .scale = 0.0f, 46 .zeroPoint = 0, 47 .lifetime = OperandLifeTime::MODEL_INPUT, 48 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 49 }, 50 { 51 .type = OperandType::TENSOR_FLOAT32, 52 .dimensions = {4, 4}, 53 .numberOfConsumers = 1, 54 .scale = 0.0f, 55 .zeroPoint = 0, 56 .lifetime = OperandLifeTime::MODEL_INPUT, 57 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 58 }, 59 { 60 .type = OperandType::TENSOR_FLOAT32, 61 .dimensions = {4, 4}, 62 .numberOfConsumers = 1, 63 .scale = 0.0f, 64 .zeroPoint = 0, 65 .lifetime = OperandLifeTime::MODEL_INPUT, 66 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 67 }, 68 { 69 .type = OperandType::TENSOR_FLOAT32, 70 .dimensions = {4, 4}, 71 .numberOfConsumers = 1, 72 .scale = 0.0f, 73 .zeroPoint = 0, 74 .lifetime = OperandLifeTime::MODEL_INPUT, 75 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 76 }, 77 { 78 .type = OperandType::TENSOR_FLOAT32, 79 .dimensions = {4, 4}, 80 .numberOfConsumers = 1, 81 .scale = 0.0f, 82 .zeroPoint = 0, 83 .lifetime = OperandLifeTime::MODEL_INPUT, 84 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 85 }, 86 { 87 .type = OperandType::TENSOR_FLOAT32, 88 .dimensions = {0}, 89 .numberOfConsumers = 1, 90 .scale = 0.0f, 91 .zeroPoint = 0, 92 .lifetime = OperandLifeTime::MODEL_INPUT, 93 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 94 }, 95 { 96 .type = OperandType::TENSOR_FLOAT32, 97 .dimensions = {0}, 98 .numberOfConsumers = 1, 99 .scale = 0.0f, 100 .zeroPoint = 0, 101 .lifetime = OperandLifeTime::MODEL_INPUT, 102 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 103 }, 104 { 105 .type = OperandType::TENSOR_FLOAT32, 106 .dimensions = {0}, 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 = {4}, 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_FLOAT32, 124 .dimensions = {4}, 125 .numberOfConsumers = 1, 126 .scale = 0.0f, 127 .zeroPoint = 0, 128 .lifetime = OperandLifeTime::MODEL_INPUT, 129 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 130 }, 131 { 132 .type = OperandType::TENSOR_FLOAT32, 133 .dimensions = {4}, 134 .numberOfConsumers = 1, 135 .scale = 0.0f, 136 .zeroPoint = 0, 137 .lifetime = OperandLifeTime::MODEL_INPUT, 138 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 139 }, 140 { 141 .type = OperandType::TENSOR_FLOAT32, 142 .dimensions = {4}, 143 .numberOfConsumers = 1, 144 .scale = 0.0f, 145 .zeroPoint = 0, 146 .lifetime = OperandLifeTime::MODEL_INPUT, 147 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 148 }, 149 { 150 .type = OperandType::TENSOR_FLOAT32, 151 .dimensions = {0,0}, 152 .numberOfConsumers = 1, 153 .scale = 0.0f, 154 .zeroPoint = 0, 155 .lifetime = OperandLifeTime::MODEL_INPUT, 156 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 157 }, 158 { 159 .type = OperandType::TENSOR_FLOAT32, 160 .dimensions = {0}, 161 .numberOfConsumers = 1, 162 .scale = 0.0f, 163 .zeroPoint = 0, 164 .lifetime = OperandLifeTime::MODEL_INPUT, 165 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 166 }, 167 { 168 .type = OperandType::TENSOR_FLOAT32, 169 .dimensions = {1, 4}, 170 .numberOfConsumers = 1, 171 .scale = 0.0f, 172 .zeroPoint = 0, 173 .lifetime = OperandLifeTime::MODEL_INPUT, 174 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 175 }, 176 { 177 .type = OperandType::TENSOR_FLOAT32, 178 .dimensions = {1, 4}, 179 .numberOfConsumers = 1, 180 .scale = 0.0f, 181 .zeroPoint = 0, 182 .lifetime = OperandLifeTime::MODEL_INPUT, 183 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 184 }, 185 { 186 .type = OperandType::INT32, 187 .dimensions = {}, 188 .numberOfConsumers = 1, 189 .scale = 0.0f, 190 .zeroPoint = 0, 191 .lifetime = OperandLifeTime::CONSTANT_COPY, 192 .location = {.poolIndex = 0, .offset = 0, .length = 4}, 193 }, 194 { 195 .type = OperandType::FLOAT32, 196 .dimensions = {}, 197 .numberOfConsumers = 1, 198 .scale = 0.0f, 199 .zeroPoint = 0, 200 .lifetime = OperandLifeTime::CONSTANT_COPY, 201 .location = {.poolIndex = 0, .offset = 4, .length = 4}, 202 }, 203 { 204 .type = OperandType::FLOAT32, 205 .dimensions = {}, 206 .numberOfConsumers = 1, 207 .scale = 0.0f, 208 .zeroPoint = 0, 209 .lifetime = OperandLifeTime::CONSTANT_COPY, 210 .location = {.poolIndex = 0, .offset = 8, .length = 4}, 211 }, 212 { 213 .type = OperandType::TENSOR_FLOAT32, 214 .dimensions = {1, 16}, 215 .numberOfConsumers = 0, 216 .scale = 0.0f, 217 .zeroPoint = 0, 218 .lifetime = OperandLifeTime::MODEL_OUTPUT, 219 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 220 }, 221 { 222 .type = OperandType::TENSOR_FLOAT32, 223 .dimensions = {1, 4}, 224 .numberOfConsumers = 0, 225 .scale = 0.0f, 226 .zeroPoint = 0, 227 .lifetime = OperandLifeTime::MODEL_OUTPUT, 228 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 229 }, 230 { 231 .type = OperandType::TENSOR_FLOAT32, 232 .dimensions = {1, 4}, 233 .numberOfConsumers = 0, 234 .scale = 0.0f, 235 .zeroPoint = 0, 236 .lifetime = OperandLifeTime::MODEL_OUTPUT, 237 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 238 }, 239 { 240 .type = OperandType::TENSOR_FLOAT32, 241 .dimensions = {1, 4}, 242 .numberOfConsumers = 0, 243 .scale = 0.0f, 244 .zeroPoint = 0, 245 .lifetime = OperandLifeTime::MODEL_OUTPUT, 246 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 247 } 248 }; 249 250 const std::vector<Operation> operations = { 251 { 252 .type = OperationType::LSTM, 253 .inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22}, 254 .outputs = {23, 24, 25, 26}, 255 } 256 }; 257 258 const std::vector<uint32_t> inputIndexes = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19}; 259 const std::vector<uint32_t> outputIndexes = {23, 24, 25, 26}; 260 std::vector<uint8_t> operandValues = { 261 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 262 }; 263 const std::vector<hidl_memory> pools = {}; 264 265 return { 266 .operands = operands, 267 .operations = operations, 268 .inputIndexes = inputIndexes, 269 .outputIndexes = outputIndexes, 270 .operandValues = operandValues, 271 .pools = pools, 272 }; 273 } 274 275 276 bool is_ignored(int i) { 277 static std::set<int> ignore = {1, 2, 0}; 278 return ignore.find(i) != ignore.end(); 279 } 280