Lines Matching refs:model
124 void logModelToInfo(const V1_0::Model& model) { in logModelToInfo() argument
126 LOG(INFO) << "operands" << toString(model.operands); in logModelToInfo()
127 LOG(INFO) << "operations" << toString(model.operations); in logModelToInfo()
128 LOG(INFO) << "inputIndexes" << toString(model.inputIndexes); in logModelToInfo()
129 LOG(INFO) << "outputIndexes" << toString(model.outputIndexes); in logModelToInfo()
130 LOG(INFO) << "operandValues size" << model.operandValues.size(); in logModelToInfo()
131 LOG(INFO) << "pools" << SHOW_IF_DEBUG(toString(model.pools)); in logModelToInfo()
134 void logModelToInfo(const V1_1::Model& model) { in logModelToInfo() argument
136 LOG(INFO) << "operands" << toString(model.operands); in logModelToInfo()
137 LOG(INFO) << "operations" << toString(model.operations); in logModelToInfo()
138 LOG(INFO) << "inputIndexes" << toString(model.inputIndexes); in logModelToInfo()
139 LOG(INFO) << "outputIndexes" << toString(model.outputIndexes); in logModelToInfo()
140 LOG(INFO) << "operandValues size " << model.operandValues.size(); in logModelToInfo()
141 LOG(INFO) << "pools" << SHOW_IF_DEBUG(toString(model.pools)); in logModelToInfo()
144 void logModelToInfo(const V1_2::Model& model) { in logModelToInfo() argument
146 LOG(INFO) << "operands" << toString(model.operands); in logModelToInfo()
147 LOG(INFO) << "operations" << toString(model.operations); in logModelToInfo()
148 LOG(INFO) << "inputIndexes" << toString(model.inputIndexes); in logModelToInfo()
149 LOG(INFO) << "outputIndexes" << toString(model.outputIndexes); in logModelToInfo()
150 LOG(INFO) << "operandValues size" << model.operandValues.size(); in logModelToInfo()
151 LOG(INFO) << "pools" << SHOW_IF_DEBUG(toString(model.pools)); in logModelToInfo()
152 LOG(INFO) << "relaxComputationFloat32toFloat16" << model.relaxComputationFloat32toFloat16; in logModelToInfo()
153 LOG(INFO) << "extensionNameToPrefix" << toString(model.extensionNameToPrefix); in logModelToInfo()
163 void logModelToInfo(const V1_3::Model& model) { in logModelToInfo() argument
165 logSubgraphToInfo("main", model.main); in logModelToInfo()
166 for (uint32_t i = 0, n = model.referenced.size(); i < n; ++i) { in logModelToInfo()
167 logSubgraphToInfo("referenced[" + std::to_string(i) + "]", model.referenced[i]); in logModelToInfo()
169 LOG(INFO) << "operandValues size " << model.operandValues.size(); in logModelToInfo()
170 LOG(INFO) << "pools" << SHOW_IF_DEBUG(toString(model.pools)); in logModelToInfo()
171 LOG(INFO) << "relaxComputationFloat32toFloat16 " << model.relaxComputationFloat32toFloat16; in logModelToInfo()
172 LOG(INFO) << "extensionNameToPrefix" << toString(model.extensionNameToPrefix); in logModelToInfo()
785 static bool compliantWith(HalVersion version, const V1_3::Model& model, in compliantWith() argument
788 std::vector<bool> isPoolCompliant(model.pools.size(), false); in compliantWith()
790 model.pools.begin(), model.pools.end(), isPoolCompliant.begin(), in compliantWith()
794 std::vector<bool> isOperandCompliant(model.main.operands.size(), false); in compliantWith()
795 std::transform(model.main.operands.begin(), model.main.operands.end(), in compliantWith()
834 auto localValidateOperation = [&model, version, in compliantWith()
841 uncheckedConvert(model.main.operands), version); in compliantWith()
847 for (uint32_t idx = 0; idx < model.main.operations.size(); ++idx) { in compliantWith()
848 if (!localValidateOperation(model.main.operations[idx])) { in compliantWith()
854 return std::all_of(model.main.operations.begin(), model.main.operations.end(), in compliantWith()
863 bool compliantWithV1_0(const V1_1::Model& model) { in compliantWithV1_0() argument
871 auto operands = uncheckedConvert(convertToV1_3(model.operands)); in compliantWithV1_0()
872 return std::all_of(model.operations.begin(), model.operations.end(), in compliantWithV1_0()
884 bool compliantWithV1_0(const V1_2::Model& model, std::set<uint32_t>* noncompliantOperations) { in compliantWithV1_0() argument
885 return compliantWith(HalVersion::V1_0, convertToV1_3(model), noncompliantOperations); in compliantWithV1_0()
888 bool compliantWithV1_0(const V1_3::Model& model, std::set<uint32_t>* noncompliantOperations) { in compliantWithV1_0() argument
889 return compliantWith(HalVersion::V1_0, model, noncompliantOperations); in compliantWithV1_0()
900 bool compliantWithV1_1(const V1_2::Model& model, std::set<uint32_t>* noncompliantOperations) { in compliantWithV1_1() argument
901 return compliantWith(HalVersion::V1_1, convertToV1_3(model), noncompliantOperations); in compliantWithV1_1()
904 bool compliantWithV1_1(const V1_3::Model& model, std::set<uint32_t>* noncompliantOperations) { in compliantWithV1_1() argument
905 return compliantWith(HalVersion::V1_1, model, noncompliantOperations); in compliantWithV1_1()
920 bool compliantWithV1_2(const V1_3::Model& model, std::set<uint32_t>* noncompliantOperations) { in compliantWithV1_2() argument
921 return compliantWith(HalVersion::V1_2, model, noncompliantOperations); in compliantWithV1_2()
1265 V1_0::Model convertToV1_0(const V1_0::Model& model) { in convertToV1_0() argument
1266 return model; in convertToV1_0()
1269 V1_0::Model convertToV1_0(const V1_1::Model& model) { in convertToV1_0() argument
1270 if (!compliantWithV1_0(model)) { in convertToV1_0()
1271 LOG(ERROR) << "Upcasting non-compliant model " << SHOW_IF_DEBUG(toString(model)) in convertToV1_0()
1274 return {.operands = model.operands, in convertToV1_0()
1275 .operations = uncheckedConvertToV1_0(model.operations), in convertToV1_0()
1276 .inputIndexes = model.inputIndexes, in convertToV1_0()
1277 .outputIndexes = model.outputIndexes, in convertToV1_0()
1278 .operandValues = model.operandValues, in convertToV1_0()
1279 .pools = model.pools}; in convertToV1_0()
1282 V1_0::Model convertToV1_0(const V1_2::Model& model) { in convertToV1_0() argument
1283 if (!compliantWithV1_0(model)) { in convertToV1_0()
1284 LOG(ERROR) << "Upcasting non-compliant model " << SHOW_IF_DEBUG(toString(model)) in convertToV1_0()
1287 return {.operands = convertToV1_0(model.operands), in convertToV1_0()
1288 .operations = uncheckedConvertToV1_0(model.operations), in convertToV1_0()
1289 .inputIndexes = model.inputIndexes, in convertToV1_0()
1290 .outputIndexes = model.outputIndexes, in convertToV1_0()
1291 .operandValues = model.operandValues, in convertToV1_0()
1292 .pools = model.pools}; in convertToV1_0()
1295 V1_0::Model convertToV1_0(const V1_3::Model& model) { in convertToV1_0() argument
1296 if (!compliantWithV1_0(model)) { in convertToV1_0()
1297 LOG(ERROR) << "Upcasting non-compliant model " << SHOW_IF_DEBUG(toString(model)) in convertToV1_0()
1300 return {.operands = convertToV1_0(model.main.operands), in convertToV1_0()
1301 .operations = uncheckedConvertToV1_0(model.main.operations), in convertToV1_0()
1302 .inputIndexes = model.main.inputIndexes, in convertToV1_0()
1303 .outputIndexes = model.main.outputIndexes, in convertToV1_0()
1304 .operandValues = model.operandValues, in convertToV1_0()
1305 .pools = model.pools}; in convertToV1_0()
1308 V1_1::Model convertToV1_1(const V1_0::Model& model) { in convertToV1_1() argument
1309 return {.operands = model.operands, in convertToV1_1()
1310 .operations = convertToV1_1(model.operations), in convertToV1_1()
1311 .inputIndexes = model.inputIndexes, in convertToV1_1()
1312 .outputIndexes = model.outputIndexes, in convertToV1_1()
1313 .operandValues = model.operandValues, in convertToV1_1()
1314 .pools = model.pools, in convertToV1_1()
1318 V1_1::Model convertToV1_1(const V1_1::Model& model) { in convertToV1_1() argument
1319 return model; in convertToV1_1()
1322 V1_1::Model convertToV1_1(const V1_2::Model& model) { in convertToV1_1() argument
1323 if (!compliantWithV1_1(model)) { in convertToV1_1()
1324 LOG(ERROR) << "Upcasting non-compliant model " << SHOW_IF_DEBUG(toString(model)) in convertToV1_1()
1327 return {.operands = convertToV1_0(model.operands), // Operands in 1.1 and 1.0 are identical. in convertToV1_1()
1328 .operations = uncheckedConvertToV1_1(model.operations), in convertToV1_1()
1329 .inputIndexes = model.inputIndexes, in convertToV1_1()
1330 .outputIndexes = model.outputIndexes, in convertToV1_1()
1331 .operandValues = model.operandValues, in convertToV1_1()
1332 .pools = model.pools, in convertToV1_1()
1333 .relaxComputationFloat32toFloat16 = model.relaxComputationFloat32toFloat16}; in convertToV1_1()
1336 V1_1::Model convertToV1_1(const V1_3::Model& model) { in convertToV1_1() argument
1337 if (!compliantWithV1_1(model)) { in convertToV1_1()
1338 LOG(ERROR) << "Upcasting non-compliant model " << SHOW_IF_DEBUG(toString(model)) in convertToV1_1()
1342 .operands = convertToV1_0(model.main.operands), in convertToV1_1()
1343 .operations = uncheckedConvertToV1_1(model.main.operations), in convertToV1_1()
1344 .inputIndexes = model.main.inputIndexes, in convertToV1_1()
1345 .outputIndexes = model.main.outputIndexes, in convertToV1_1()
1346 .operandValues = model.operandValues, in convertToV1_1()
1347 .pools = model.pools, in convertToV1_1()
1348 .relaxComputationFloat32toFloat16 = model.relaxComputationFloat32toFloat16}; in convertToV1_1()
1351 V1_2::Model convertToV1_2(const V1_0::Model& model) { in convertToV1_2() argument
1352 return {.operands = convertToV1_2(model.operands), in convertToV1_2()
1353 .operations = convertToV1_2(model.operations), in convertToV1_2()
1354 .inputIndexes = model.inputIndexes, in convertToV1_2()
1355 .outputIndexes = model.outputIndexes, in convertToV1_2()
1356 .operandValues = model.operandValues, in convertToV1_2()
1357 .pools = model.pools, in convertToV1_2()
1361 V1_2::Model convertToV1_2(const V1_1::Model& model) { in convertToV1_2() argument
1362 return {.operands = convertToV1_2(model.operands), in convertToV1_2()
1363 .operations = convertToV1_2(model.operations), in convertToV1_2()
1364 .inputIndexes = model.inputIndexes, in convertToV1_2()
1365 .outputIndexes = model.outputIndexes, in convertToV1_2()
1366 .operandValues = model.operandValues, in convertToV1_2()
1367 .pools = model.pools, in convertToV1_2()
1368 .relaxComputationFloat32toFloat16 = model.relaxComputationFloat32toFloat16}; in convertToV1_2()
1371 V1_2::Model convertToV1_2(const V1_2::Model& model) { in convertToV1_2() argument
1372 return model; in convertToV1_2()
1375 V1_2::Model convertToV1_2(const V1_3::Model& model) { in convertToV1_2() argument
1376 if (!compliantWithV1_2(model)) { in convertToV1_2()
1377 LOG(ERROR) << "Upcasting non-compliant model " << SHOW_IF_DEBUG(toString(model)) in convertToV1_2()
1380 return {.operands = convertToV1_2(model.main.operands), in convertToV1_2()
1381 .operations = uncheckedConvertToV1_2(model.main.operations), in convertToV1_2()
1382 .inputIndexes = model.main.inputIndexes, in convertToV1_2()
1383 .outputIndexes = model.main.outputIndexes, in convertToV1_2()
1384 .operandValues = model.operandValues, in convertToV1_2()
1385 .pools = model.pools, in convertToV1_2()
1386 .relaxComputationFloat32toFloat16 = model.relaxComputationFloat32toFloat16, in convertToV1_2()
1387 .extensionNameToPrefix = model.extensionNameToPrefix}; in convertToV1_2()
1390 V1_3::Model convertToV1_3(const V1_0::Model& model) { in convertToV1_3() argument
1391 return {.main = {.operands = convertToV1_3(model.operands), in convertToV1_3()
1392 .operations = convertToV1_3(model.operations), in convertToV1_3()
1393 .inputIndexes = model.inputIndexes, in convertToV1_3()
1394 .outputIndexes = model.outputIndexes}, in convertToV1_3()
1395 .operandValues = model.operandValues, in convertToV1_3()
1396 .pools = model.pools, in convertToV1_3()
1400 V1_3::Model convertToV1_3(const V1_1::Model& model) { in convertToV1_3() argument
1401 return {.main = {.operands = convertToV1_3(model.operands), in convertToV1_3()
1402 .operations = convertToV1_3(model.operations), in convertToV1_3()
1403 .inputIndexes = model.inputIndexes, in convertToV1_3()
1404 .outputIndexes = model.outputIndexes}, in convertToV1_3()
1405 .operandValues = model.operandValues, in convertToV1_3()
1406 .pools = model.pools, in convertToV1_3()
1407 .relaxComputationFloat32toFloat16 = model.relaxComputationFloat32toFloat16}; in convertToV1_3()
1410 V1_3::Model convertToV1_3(const V1_2::Model& model) { in convertToV1_3() argument
1411 return {.main = {.operands = convertToV1_3(model.operands), in convertToV1_3()
1412 .operations = convertToV1_3(model.operations), in convertToV1_3()
1413 .inputIndexes = model.inputIndexes, in convertToV1_3()
1414 .outputIndexes = model.outputIndexes}, in convertToV1_3()
1415 .operandValues = model.operandValues, in convertToV1_3()
1416 .pools = model.pools, in convertToV1_3()
1417 .relaxComputationFloat32toFloat16 = model.relaxComputationFloat32toFloat16, in convertToV1_3()
1418 .extensionNameToPrefix = model.extensionNameToPrefix}; in convertToV1_3()
1421 V1_3::Model convertToV1_3(const V1_3::Model& model) { in convertToV1_3() argument
1422 return model; in convertToV1_3()
1560 Model uncheckedConvert(const V1_3::Model& model) { in uncheckedConvert() argument
1561 return handleError(convert(model)); in uncheckedConvert()
1715 V1_3::Model convertToV1_3(const Model& model) { in convertToV1_3() argument
1716 return handleError(V1_3::utils::convert(model)); in convertToV1_3()