1 // clang-format off 2 // Generated file (from: svdf2_relaxed.mod.py). Do not edit 3 // Create the model 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_FLOAT32, 17 .dimensions = {8, 3}, 18 .numberOfConsumers = 1, 19 .scale = 0.0f, 20 .zeroPoint = 0, 21 .lifetime = OperandLifeTime::MODEL_INPUT, 22 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 23 }, 24 { 25 .type = OperandType::TENSOR_FLOAT32, 26 .dimensions = {8, 10}, 27 .numberOfConsumers = 1, 28 .scale = 0.0f, 29 .zeroPoint = 0, 30 .lifetime = OperandLifeTime::MODEL_INPUT, 31 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 32 }, 33 { 34 .type = OperandType::TENSOR_FLOAT32, 35 .dimensions = {4}, 36 .numberOfConsumers = 1, 37 .scale = 0.0f, 38 .zeroPoint = 0, 39 .lifetime = OperandLifeTime::MODEL_INPUT, 40 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 41 }, 42 { 43 .type = OperandType::TENSOR_FLOAT32, 44 .dimensions = {2, 80}, 45 .numberOfConsumers = 1, 46 .scale = 0.0f, 47 .zeroPoint = 0, 48 .lifetime = OperandLifeTime::MODEL_INPUT, 49 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 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 = 0, .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 = 4, .length = 4}, 68 }, 69 { 70 .type = OperandType::TENSOR_FLOAT32, 71 .dimensions = {2, 80}, 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 .type = OperandType::TENSOR_FLOAT32, 80 .dimensions = {2, 4}, 81 .numberOfConsumers = 0, 82 .scale = 0.0f, 83 .zeroPoint = 0, 84 .lifetime = OperandLifeTime::MODEL_OUTPUT, 85 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 86 } 87 }; 88 89 const std::vector<Operation> operations = { 90 { 91 .type = OperationType::SVDF, 92 .inputs = {0, 1, 2, 3, 4, 5, 6}, 93 .outputs = {7, 8}, 94 } 95 }; 96 97 const std::vector<uint32_t> inputIndexes = {0, 1, 2, 3, 4}; 98 const std::vector<uint32_t> outputIndexes = {7, 8}; 99 std::vector<uint8_t> operandValues = { 100 2, 0, 0, 0, 0, 0, 0, 0 101 }; 102 const std::vector<hidl_memory> pools = {}; 103 104 return { 105 .operands = operands, 106 .operations = operations, 107 .inputIndexes = inputIndexes, 108 .outputIndexes = outputIndexes, 109 .operandValues = operandValues, 110 .pools = pools, 111 .relaxComputationFloat32toFloat16 = true, 112 }; 113 } 114 115 inline bool is_ignored(int i) { 116 static std::set<int> ignore = {0}; 117 return ignore.find(i) != ignore.end(); 118 } 119 120 // Create the model 121 Model createTestModel_dynamic_output_shape() { 122 const std::vector<Operand> operands = { 123 { 124 .type = OperandType::TENSOR_FLOAT32, 125 .dimensions = {2, 3}, 126 .numberOfConsumers = 1, 127 .scale = 0.0f, 128 .zeroPoint = 0, 129 .lifetime = OperandLifeTime::MODEL_INPUT, 130 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 131 }, 132 { 133 .type = OperandType::TENSOR_FLOAT32, 134 .dimensions = {8, 3}, 135 .numberOfConsumers = 1, 136 .scale = 0.0f, 137 .zeroPoint = 0, 138 .lifetime = OperandLifeTime::MODEL_INPUT, 139 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 140 }, 141 { 142 .type = OperandType::TENSOR_FLOAT32, 143 .dimensions = {8, 10}, 144 .numberOfConsumers = 1, 145 .scale = 0.0f, 146 .zeroPoint = 0, 147 .lifetime = OperandLifeTime::MODEL_INPUT, 148 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 149 }, 150 { 151 .type = OperandType::TENSOR_FLOAT32, 152 .dimensions = {4}, 153 .numberOfConsumers = 1, 154 .scale = 0.0f, 155 .zeroPoint = 0, 156 .lifetime = OperandLifeTime::MODEL_INPUT, 157 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 158 }, 159 { 160 .type = OperandType::TENSOR_FLOAT32, 161 .dimensions = {2, 80}, 162 .numberOfConsumers = 1, 163 .scale = 0.0f, 164 .zeroPoint = 0, 165 .lifetime = OperandLifeTime::MODEL_INPUT, 166 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 167 }, 168 { 169 .type = OperandType::INT32, 170 .dimensions = {}, 171 .numberOfConsumers = 1, 172 .scale = 0.0f, 173 .zeroPoint = 0, 174 .lifetime = OperandLifeTime::CONSTANT_COPY, 175 .location = {.poolIndex = 0, .offset = 0, .length = 4}, 176 }, 177 { 178 .type = OperandType::INT32, 179 .dimensions = {}, 180 .numberOfConsumers = 1, 181 .scale = 0.0f, 182 .zeroPoint = 0, 183 .lifetime = OperandLifeTime::CONSTANT_COPY, 184 .location = {.poolIndex = 0, .offset = 4, .length = 4}, 185 }, 186 { 187 .type = OperandType::TENSOR_FLOAT32, 188 .dimensions = {0, 0}, 189 .numberOfConsumers = 0, 190 .scale = 0.0f, 191 .zeroPoint = 0, 192 .lifetime = OperandLifeTime::MODEL_OUTPUT, 193 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 194 }, 195 { 196 .type = OperandType::TENSOR_FLOAT32, 197 .dimensions = {0, 0}, 198 .numberOfConsumers = 0, 199 .scale = 0.0f, 200 .zeroPoint = 0, 201 .lifetime = OperandLifeTime::MODEL_OUTPUT, 202 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 203 } 204 }; 205 206 const std::vector<Operation> operations = { 207 { 208 .type = OperationType::SVDF, 209 .inputs = {0, 1, 2, 3, 4, 5, 6}, 210 .outputs = {7, 8}, 211 } 212 }; 213 214 const std::vector<uint32_t> inputIndexes = {0, 1, 2, 3, 4}; 215 const std::vector<uint32_t> outputIndexes = {7, 8}; 216 std::vector<uint8_t> operandValues = { 217 2, 0, 0, 0, 0, 0, 0, 0 218 }; 219 const std::vector<hidl_memory> pools = {}; 220 221 return { 222 .operands = operands, 223 .operations = operations, 224 .inputIndexes = inputIndexes, 225 .outputIndexes = outputIndexes, 226 .operandValues = operandValues, 227 .pools = pools, 228 .relaxComputationFloat32toFloat16 = true, 229 }; 230 } 231 232 inline bool is_ignored_dynamic_output_shape(int i) { 233 static std::set<int> ignore = {0}; 234 return ignore.find(i) != ignore.end(); 235 } 236 237