| // Generated from concat_mixed_quant.mod.py |
| // DO NOT EDIT |
| // clang-format off |
| #include "GeneratedTests.h" |
| |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::concat_mixed_quant { |
| |
| Model createTestModel_quant8() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {2, 1, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.084f, |
| .zeroPoint = 127, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {2, 1, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.05f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {2, 1, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.089f, |
| .zeroPoint = 123, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {2, 1, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.029f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 4}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {2, 1, 8}, |
| .numberOfConsumers = 0, |
| .scale = 0.1f, |
| .zeroPoint = 127, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::CONCATENATION, |
| .inputs = {0, 1, 2, 3, 4}, |
| .outputs = {5}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {0, 1, 2, 3}; |
| const std::vector<uint32_t> outputIndexes = {5}; |
| std::vector<uint8_t> operandValues = { |
| 2, 0, 0, 0 |
| }; |
| const std::vector<hidl_memory> pools = {}; |
| |
| return { |
| .operands = operands, |
| .operations = operations, |
| .inputIndexes = inputIndexes, |
| .outputIndexes = outputIndexes, |
| .operandValues = operandValues, |
| .pools = pools, |
| }; |
| } |
| |
| bool is_ignored_quant8(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::concat_mixed_quant |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::concat_mixed_quant { |
| |
| Model createTestModel_quant8_dynamic_output_shape() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {2, 1, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.084f, |
| .zeroPoint = 127, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {2, 1, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.05f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {2, 1, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.089f, |
| .zeroPoint = 123, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {2, 1, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.029f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 4}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {0, 0, 0}, |
| .numberOfConsumers = 0, |
| .scale = 0.1f, |
| .zeroPoint = 127, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::CONCATENATION, |
| .inputs = {0, 1, 2, 3, 4}, |
| .outputs = {5}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {0, 1, 2, 3}; |
| const std::vector<uint32_t> outputIndexes = {5}; |
| std::vector<uint8_t> operandValues = { |
| 2, 0, 0, 0 |
| }; |
| const std::vector<hidl_memory> pools = {}; |
| |
| return { |
| .operands = operands, |
| .operations = operations, |
| .inputIndexes = inputIndexes, |
| .outputIndexes = outputIndexes, |
| .operandValues = operandValues, |
| .pools = pools, |
| }; |
| } |
| |
| bool is_ignored_quant8_dynamic_output_shape(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::concat_mixed_quant |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::concat_mixed_quant { |
| |
| Model createTestModel_quant8_all_inputs_as_internal() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {2, 1, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.084f, |
| .zeroPoint = 127, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {2, 1, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.05f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {2, 1, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.089f, |
| .zeroPoint = 123, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {2, 1, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.029f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 4}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {2, 1, 8}, |
| .numberOfConsumers = 0, |
| .scale = 0.1f, |
| .zeroPoint = 127, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {2, 1, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.084f, |
| .zeroPoint = 127, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.084f, |
| .zeroPoint = 127, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 4, .length = 1}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 5, .length = 4}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {2, 1, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.05f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.05f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 9, .length = 1}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 10, .length = 4}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {2, 1, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.089f, |
| .zeroPoint = 123, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.089f, |
| .zeroPoint = 123, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 14, .length = 1}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 15, .length = 4}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {2, 1, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.029f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.029f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 19, .length = 1}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ADD, |
| .inputs = {6, 7, 8}, |
| .outputs = {0}, |
| }, |
| { |
| .type = OperationType::ADD, |
| .inputs = {9, 10, 11}, |
| .outputs = {1}, |
| }, |
| { |
| .type = OperationType::ADD, |
| .inputs = {12, 13, 14}, |
| .outputs = {2}, |
| }, |
| { |
| .type = OperationType::ADD, |
| .inputs = {15, 16, 17}, |
| .outputs = {3}, |
| }, |
| { |
| .type = OperationType::CONCATENATION, |
| .inputs = {0, 1, 2, 3, 4}, |
| .outputs = {5}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {6, 9, 12, 15}; |
| const std::vector<uint32_t> outputIndexes = {5}; |
| std::vector<uint8_t> operandValues = { |
| 2, 0, 0, 0, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 123, 0, 0, 0, 0, 0, 0, 0, 0, 0 |
| }; |
| const std::vector<hidl_memory> pools = {}; |
| |
| return { |
| .operands = operands, |
| .operations = operations, |
| .inputIndexes = inputIndexes, |
| .outputIndexes = outputIndexes, |
| .operandValues = operandValues, |
| .pools = pools, |
| }; |
| } |
| |
| bool is_ignored_quant8_all_inputs_as_internal(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::concat_mixed_quant |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::concat_mixed_quant { |
| |
| Model createTestModel_quant8_all_inputs_as_internal_dynamic_output_shape() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {2, 1, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.084f, |
| .zeroPoint = 127, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {2, 1, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.05f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {2, 1, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.089f, |
| .zeroPoint = 123, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {2, 1, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.029f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 4}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {0, 0, 0}, |
| .numberOfConsumers = 0, |
| .scale = 0.1f, |
| .zeroPoint = 127, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {2, 1, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.084f, |
| .zeroPoint = 127, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.084f, |
| .zeroPoint = 127, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 4, .length = 1}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 5, .length = 4}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {2, 1, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.05f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.05f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 9, .length = 1}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 10, .length = 4}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {2, 1, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.089f, |
| .zeroPoint = 123, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.089f, |
| .zeroPoint = 123, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 14, .length = 1}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 15, .length = 4}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {2, 1, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.029f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.029f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 19, .length = 1}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ADD, |
| .inputs = {6, 7, 8}, |
| .outputs = {0}, |
| }, |
| { |
| .type = OperationType::ADD, |
| .inputs = {9, 10, 11}, |
| .outputs = {1}, |
| }, |
| { |
| .type = OperationType::ADD, |
| .inputs = {12, 13, 14}, |
| .outputs = {2}, |
| }, |
| { |
| .type = OperationType::ADD, |
| .inputs = {15, 16, 17}, |
| .outputs = {3}, |
| }, |
| { |
| .type = OperationType::CONCATENATION, |
| .inputs = {0, 1, 2, 3, 4}, |
| .outputs = {5}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {6, 9, 12, 15}; |
| const std::vector<uint32_t> outputIndexes = {5}; |
| std::vector<uint8_t> operandValues = { |
| 2, 0, 0, 0, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 123, 0, 0, 0, 0, 0, 0, 0, 0, 0 |
| }; |
| const std::vector<hidl_memory> pools = {}; |
| |
| return { |
| .operands = operands, |
| .operations = operations, |
| .inputIndexes = inputIndexes, |
| .outputIndexes = outputIndexes, |
| .operandValues = operandValues, |
| .pools = pools, |
| }; |
| } |
| |
| bool is_ignored_quant8_all_inputs_as_internal_dynamic_output_shape(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::concat_mixed_quant |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::concat_mixed_quant { |
| |
| Model createTestModel_quant8_2() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {2, 1, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.084f, |
| .zeroPoint = 127, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {2, 1, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.05f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {2, 1, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.089f, |
| .zeroPoint = 123, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {2, 1, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.029f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 4}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {2, 1, 8}, |
| .numberOfConsumers = 0, |
| .scale = 0.0078125f, |
| .zeroPoint = 127, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::CONCATENATION, |
| .inputs = {0, 1, 2, 3, 4}, |
| .outputs = {5}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {0, 1, 2, 3}; |
| const std::vector<uint32_t> outputIndexes = {5}; |
| std::vector<uint8_t> operandValues = { |
| 2, 0, 0, 0 |
| }; |
| const std::vector<hidl_memory> pools = {}; |
| |
| return { |
| .operands = operands, |
| .operations = operations, |
| .inputIndexes = inputIndexes, |
| .outputIndexes = outputIndexes, |
| .operandValues = operandValues, |
| .pools = pools, |
| }; |
| } |
| |
| bool is_ignored_quant8_2(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::concat_mixed_quant |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::concat_mixed_quant { |
| |
| Model createTestModel_quant8_dynamic_output_shape_2() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {2, 1, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.084f, |
| .zeroPoint = 127, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {2, 1, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.05f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {2, 1, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.089f, |
| .zeroPoint = 123, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {2, 1, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.029f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 4}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {0, 0, 0}, |
| .numberOfConsumers = 0, |
| .scale = 0.0078125f, |
| .zeroPoint = 127, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::CONCATENATION, |
| .inputs = {0, 1, 2, 3, 4}, |
| .outputs = {5}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {0, 1, 2, 3}; |
| const std::vector<uint32_t> outputIndexes = {5}; |
| std::vector<uint8_t> operandValues = { |
| 2, 0, 0, 0 |
| }; |
| const std::vector<hidl_memory> pools = {}; |
| |
| return { |
| .operands = operands, |
| .operations = operations, |
| .inputIndexes = inputIndexes, |
| .outputIndexes = outputIndexes, |
| .operandValues = operandValues, |
| .pools = pools, |
| }; |
| } |
| |
| bool is_ignored_quant8_dynamic_output_shape_2(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::concat_mixed_quant |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::concat_mixed_quant { |
| |
| Model createTestModel_quant8_all_inputs_as_internal_2() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {2, 1, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.084f, |
| .zeroPoint = 127, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {2, 1, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.05f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {2, 1, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.089f, |
| .zeroPoint = 123, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {2, 1, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.029f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 4}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {2, 1, 8}, |
| .numberOfConsumers = 0, |
| .scale = 0.0078125f, |
| .zeroPoint = 127, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {2, 1, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.084f, |
| .zeroPoint = 127, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.084f, |
| .zeroPoint = 127, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 4, .length = 1}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 5, .length = 4}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {2, 1, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.05f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.05f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 9, .length = 1}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 10, .length = 4}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {2, 1, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.089f, |
| .zeroPoint = 123, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.089f, |
| .zeroPoint = 123, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 14, .length = 1}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 15, .length = 4}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {2, 1, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.029f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.029f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 19, .length = 1}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ADD, |
| .inputs = {6, 7, 8}, |
| .outputs = {0}, |
| }, |
| { |
| .type = OperationType::ADD, |
| .inputs = {9, 10, 11}, |
| .outputs = {1}, |
| }, |
| { |
| .type = OperationType::ADD, |
| .inputs = {12, 13, 14}, |
| .outputs = {2}, |
| }, |
| { |
| .type = OperationType::ADD, |
| .inputs = {15, 16, 17}, |
| .outputs = {3}, |
| }, |
| { |
| .type = OperationType::CONCATENATION, |
| .inputs = {0, 1, 2, 3, 4}, |
| .outputs = {5}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {6, 9, 12, 15}; |
| const std::vector<uint32_t> outputIndexes = {5}; |
| std::vector<uint8_t> operandValues = { |
| 2, 0, 0, 0, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 123, 0, 0, 0, 0, 0, 0, 0, 0, 0 |
| }; |
| const std::vector<hidl_memory> pools = {}; |
| |
| return { |
| .operands = operands, |
| .operations = operations, |
| .inputIndexes = inputIndexes, |
| .outputIndexes = outputIndexes, |
| .operandValues = operandValues, |
| .pools = pools, |
| }; |
| } |
| |
| bool is_ignored_quant8_all_inputs_as_internal_2(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::concat_mixed_quant |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::concat_mixed_quant { |
| |
| Model createTestModel_quant8_all_inputs_as_internal_dynamic_output_shape_2() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {2, 1, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.084f, |
| .zeroPoint = 127, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {2, 1, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.05f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {2, 1, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.089f, |
| .zeroPoint = 123, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {2, 1, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.029f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 4}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {0, 0, 0}, |
| .numberOfConsumers = 0, |
| .scale = 0.0078125f, |
| .zeroPoint = 127, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {2, 1, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.084f, |
| .zeroPoint = 127, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.084f, |
| .zeroPoint = 127, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 4, .length = 1}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 5, .length = 4}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {2, 1, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.05f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.05f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 9, .length = 1}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 10, .length = 4}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {2, 1, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.089f, |
| .zeroPoint = 123, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.089f, |
| .zeroPoint = 123, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 14, .length = 1}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 15, .length = 4}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {2, 1, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.029f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.029f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 19, .length = 1}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ADD, |
| .inputs = {6, 7, 8}, |
| .outputs = {0}, |
| }, |
| { |
| .type = OperationType::ADD, |
| .inputs = {9, 10, 11}, |
| .outputs = {1}, |
| }, |
| { |
| .type = OperationType::ADD, |
| .inputs = {12, 13, 14}, |
| .outputs = {2}, |
| }, |
| { |
| .type = OperationType::ADD, |
| .inputs = {15, 16, 17}, |
| .outputs = {3}, |
| }, |
| { |
| .type = OperationType::CONCATENATION, |
| .inputs = {0, 1, 2, 3, 4}, |
| .outputs = {5}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {6, 9, 12, 15}; |
| const std::vector<uint32_t> outputIndexes = {5}; |
| std::vector<uint8_t> operandValues = { |
| 2, 0, 0, 0, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 123, 0, 0, 0, 0, 0, 0, 0, 0, 0 |
| }; |
| const std::vector<hidl_memory> pools = {}; |
| |
| return { |
| .operands = operands, |
| .operations = operations, |
| .inputIndexes = inputIndexes, |
| .outputIndexes = outputIndexes, |
| .operandValues = operandValues, |
| .pools = pools, |
| }; |
| } |
| |
| bool is_ignored_quant8_all_inputs_as_internal_dynamic_output_shape_2(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::concat_mixed_quant |