| // Generated from roi_pooling.mod.py |
| // DO NOT EDIT |
| // clang-format off |
| #include "GeneratedTests.h" |
| |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nhwc() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1, 4, 4, 1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 36, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 2, 2, 1}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {0, 1}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 64, 0 |
| }; |
| const std::vector<hidl_memory> pools = {}; |
| |
| return { |
| .operands = operands, |
| .operations = operations, |
| .inputIndexes = inputIndexes, |
| .outputIndexes = outputIndexes, |
| .operandValues = operandValues, |
| .pools = pools, |
| }; |
| } |
| |
| bool is_ignored_nhwc(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nhwc_dynamic_output_shape() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1, 4, 4, 1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 36, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {0, 0, 0, 0}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {0, 1}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 64, 0 |
| }; |
| const std::vector<hidl_memory> pools = {}; |
| |
| return { |
| .operands = operands, |
| .operations = operations, |
| .inputIndexes = inputIndexes, |
| .outputIndexes = outputIndexes, |
| .operandValues = operandValues, |
| .pools = pools, |
| }; |
| } |
| |
| bool is_ignored_nhwc_dynamic_output_shape(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nhwc_all_inputs_as_internal() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1, 4, 4, 1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 36, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 2, 2, 1}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1, 4, 4, 1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 37, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 41, .length = 4}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 45, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 49, .length = 4}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ADD, |
| .inputs = {9, 10, 11}, |
| .outputs = {0}, |
| }, |
| { |
| .type = OperationType::ADD, |
| .inputs = {12, 13, 14}, |
| .outputs = {1}, |
| }, |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {9, 12}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 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_nhwc_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::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nhwc_all_inputs_as_internal_dynamic_output_shape() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1, 4, 4, 1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 36, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {0, 0, 0, 0}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1, 4, 4, 1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 37, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 41, .length = 4}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 45, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 49, .length = 4}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ADD, |
| .inputs = {9, 10, 11}, |
| .outputs = {0}, |
| }, |
| { |
| .type = OperationType::ADD, |
| .inputs = {12, 13, 14}, |
| .outputs = {1}, |
| }, |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {9, 12}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 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_nhwc_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::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nhwc_relaxed() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1, 4, 4, 1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 36, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 2, 2, 1}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {0, 1}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 64, 0 |
| }; |
| const std::vector<hidl_memory> pools = {}; |
| |
| return { |
| .operands = operands, |
| .operations = operations, |
| .inputIndexes = inputIndexes, |
| .outputIndexes = outputIndexes, |
| .operandValues = operandValues, |
| .pools = pools, |
| .relaxComputationFloat32toFloat16 = true, |
| }; |
| } |
| |
| bool is_ignored_nhwc_relaxed(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nhwc_relaxed_dynamic_output_shape() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1, 4, 4, 1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 36, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {0, 0, 0, 0}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {0, 1}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 64, 0 |
| }; |
| const std::vector<hidl_memory> pools = {}; |
| |
| return { |
| .operands = operands, |
| .operations = operations, |
| .inputIndexes = inputIndexes, |
| .outputIndexes = outputIndexes, |
| .operandValues = operandValues, |
| .pools = pools, |
| .relaxComputationFloat32toFloat16 = true, |
| }; |
| } |
| |
| bool is_ignored_nhwc_relaxed_dynamic_output_shape(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nhwc_relaxed_all_inputs_as_internal() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1, 4, 4, 1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 36, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 2, 2, 1}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1, 4, 4, 1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 37, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 41, .length = 4}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 45, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 49, .length = 4}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ADD, |
| .inputs = {9, 10, 11}, |
| .outputs = {0}, |
| }, |
| { |
| .type = OperationType::ADD, |
| .inputs = {12, 13, 14}, |
| .outputs = {1}, |
| }, |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {9, 12}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 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, |
| .relaxComputationFloat32toFloat16 = true, |
| }; |
| } |
| |
| bool is_ignored_nhwc_relaxed_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::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nhwc_relaxed_all_inputs_as_internal_dynamic_output_shape() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1, 4, 4, 1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 36, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {0, 0, 0, 0}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1, 4, 4, 1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 37, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 41, .length = 4}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 45, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 49, .length = 4}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ADD, |
| .inputs = {9, 10, 11}, |
| .outputs = {0}, |
| }, |
| { |
| .type = OperationType::ADD, |
| .inputs = {12, 13, 14}, |
| .outputs = {1}, |
| }, |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {9, 12}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 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, |
| .relaxComputationFloat32toFloat16 = true, |
| }; |
| } |
| |
| bool is_ignored_nhwc_relaxed_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::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nhwc_quant8() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {1, 4, 4, 1}, |
| .numberOfConsumers = 1, |
| .scale = 0.25f, |
| .zeroPoint = 128, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT16_ASYMM, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.125f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 36, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {5, 2, 2, 1}, |
| .numberOfConsumers = 0, |
| .scale = 0.25f, |
| .zeroPoint = 128, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {0, 1}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 64, 0 |
| }; |
| const std::vector<hidl_memory> pools = {}; |
| |
| return { |
| .operands = operands, |
| .operations = operations, |
| .inputIndexes = inputIndexes, |
| .outputIndexes = outputIndexes, |
| .operandValues = operandValues, |
| .pools = pools, |
| }; |
| } |
| |
| bool is_ignored_nhwc_quant8(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nhwc_quant8_dynamic_output_shape() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {1, 4, 4, 1}, |
| .numberOfConsumers = 1, |
| .scale = 0.25f, |
| .zeroPoint = 128, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT16_ASYMM, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.125f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 36, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {0, 0, 0, 0}, |
| .numberOfConsumers = 0, |
| .scale = 0.25f, |
| .zeroPoint = 128, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {0, 1}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 64, 0 |
| }; |
| const std::vector<hidl_memory> pools = {}; |
| |
| return { |
| .operands = operands, |
| .operations = operations, |
| .inputIndexes = inputIndexes, |
| .outputIndexes = outputIndexes, |
| .operandValues = operandValues, |
| .pools = pools, |
| }; |
| } |
| |
| bool is_ignored_nhwc_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::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nhwc_quant8_all_inputs_as_internal() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {1, 4, 4, 1}, |
| .numberOfConsumers = 1, |
| .scale = 0.25f, |
| .zeroPoint = 128, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT16_ASYMM, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.125f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 36, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {5, 2, 2, 1}, |
| .numberOfConsumers = 0, |
| .scale = 0.25f, |
| .zeroPoint = 128, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {1, 4, 4, 1}, |
| .numberOfConsumers = 1, |
| .scale = 0.25f, |
| .zeroPoint = 128, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.25f, |
| .zeroPoint = 128, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 37, .length = 1}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 38, .length = 4}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ADD, |
| .inputs = {9, 10, 11}, |
| .outputs = {0}, |
| }, |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {1, 9}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 64, 0, 128, 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_nhwc_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::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nhwc_quant8_all_inputs_as_internal_dynamic_output_shape() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {1, 4, 4, 1}, |
| .numberOfConsumers = 1, |
| .scale = 0.25f, |
| .zeroPoint = 128, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT16_ASYMM, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.125f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 36, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {0, 0, 0, 0}, |
| .numberOfConsumers = 0, |
| .scale = 0.25f, |
| .zeroPoint = 128, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {1, 4, 4, 1}, |
| .numberOfConsumers = 1, |
| .scale = 0.25f, |
| .zeroPoint = 128, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.25f, |
| .zeroPoint = 128, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 37, .length = 1}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 38, .length = 4}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ADD, |
| .inputs = {9, 10, 11}, |
| .outputs = {0}, |
| }, |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {1, 9}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 64, 0, 128, 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_nhwc_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::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nhwc_float16() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {1, 4, 4, 1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT16, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 2}, |
| }, |
| { |
| .type = OperandType::FLOAT16, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 30, .length = 2}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {5, 2, 2, 1}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {0, 1}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 64, 0, 64, 0 |
| }; |
| const std::vector<hidl_memory> pools = {}; |
| |
| return { |
| .operands = operands, |
| .operations = operations, |
| .inputIndexes = inputIndexes, |
| .outputIndexes = outputIndexes, |
| .operandValues = operandValues, |
| .pools = pools, |
| }; |
| } |
| |
| bool is_ignored_nhwc_float16(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nhwc_float16_dynamic_output_shape() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {1, 4, 4, 1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT16, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 2}, |
| }, |
| { |
| .type = OperandType::FLOAT16, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 30, .length = 2}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {0, 0, 0, 0}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {0, 1}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 64, 0, 64, 0 |
| }; |
| const std::vector<hidl_memory> pools = {}; |
| |
| return { |
| .operands = operands, |
| .operations = operations, |
| .inputIndexes = inputIndexes, |
| .outputIndexes = outputIndexes, |
| .operandValues = operandValues, |
| .pools = pools, |
| }; |
| } |
| |
| bool is_ignored_nhwc_float16_dynamic_output_shape(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nhwc_float16_all_inputs_as_internal() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {1, 4, 4, 1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT16, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 2}, |
| }, |
| { |
| .type = OperandType::FLOAT16, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 30, .length = 2}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {5, 2, 2, 1}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {1, 4, 4, 1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 33, .length = 2}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 35, .length = 4}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 39, .length = 2}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 41, .length = 4}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ADD, |
| .inputs = {9, 10, 11}, |
| .outputs = {0}, |
| }, |
| { |
| .type = OperationType::ADD, |
| .inputs = {12, 13, 14}, |
| .outputs = {1}, |
| }, |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {9, 12}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 64, 0, 64, 0, 0, 0, 0, 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_nhwc_float16_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::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nhwc_float16_all_inputs_as_internal_dynamic_output_shape() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {1, 4, 4, 1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT16, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 2}, |
| }, |
| { |
| .type = OperandType::FLOAT16, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 30, .length = 2}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {0, 0, 0, 0}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {1, 4, 4, 1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 33, .length = 2}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 35, .length = 4}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 39, .length = 2}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 41, .length = 4}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ADD, |
| .inputs = {9, 10, 11}, |
| .outputs = {0}, |
| }, |
| { |
| .type = OperationType::ADD, |
| .inputs = {12, 13, 14}, |
| .outputs = {1}, |
| }, |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {9, 12}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 64, 0, 64, 0, 0, 0, 0, 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_nhwc_float16_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::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nchw() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1, 1, 4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 36, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 1, 2, 2}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {0, 1}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 64, 1 |
| }; |
| const std::vector<hidl_memory> pools = {}; |
| |
| return { |
| .operands = operands, |
| .operations = operations, |
| .inputIndexes = inputIndexes, |
| .outputIndexes = outputIndexes, |
| .operandValues = operandValues, |
| .pools = pools, |
| }; |
| } |
| |
| bool is_ignored_nchw(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nchw_dynamic_output_shape() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1, 1, 4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 36, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {0, 0, 0, 0}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {0, 1}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 64, 1 |
| }; |
| const std::vector<hidl_memory> pools = {}; |
| |
| return { |
| .operands = operands, |
| .operations = operations, |
| .inputIndexes = inputIndexes, |
| .outputIndexes = outputIndexes, |
| .operandValues = operandValues, |
| .pools = pools, |
| }; |
| } |
| |
| bool is_ignored_nchw_dynamic_output_shape(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nchw_all_inputs_as_internal() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1, 1, 4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 36, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 1, 2, 2}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1, 1, 4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 37, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 41, .length = 4}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 45, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 49, .length = 4}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ADD, |
| .inputs = {9, 10, 11}, |
| .outputs = {0}, |
| }, |
| { |
| .type = OperationType::ADD, |
| .inputs = {12, 13, 14}, |
| .outputs = {1}, |
| }, |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {9, 12}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 64, 1, 0, 0, 0, 0, 0, 0, 0, 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_nchw_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::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nchw_all_inputs_as_internal_dynamic_output_shape() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1, 1, 4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 36, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {0, 0, 0, 0}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1, 1, 4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 37, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 41, .length = 4}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 45, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 49, .length = 4}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ADD, |
| .inputs = {9, 10, 11}, |
| .outputs = {0}, |
| }, |
| { |
| .type = OperationType::ADD, |
| .inputs = {12, 13, 14}, |
| .outputs = {1}, |
| }, |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {9, 12}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 64, 1, 0, 0, 0, 0, 0, 0, 0, 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_nchw_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::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nchw_relaxed() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1, 1, 4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 36, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 1, 2, 2}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {0, 1}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 64, 1 |
| }; |
| const std::vector<hidl_memory> pools = {}; |
| |
| return { |
| .operands = operands, |
| .operations = operations, |
| .inputIndexes = inputIndexes, |
| .outputIndexes = outputIndexes, |
| .operandValues = operandValues, |
| .pools = pools, |
| .relaxComputationFloat32toFloat16 = true, |
| }; |
| } |
| |
| bool is_ignored_nchw_relaxed(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nchw_relaxed_dynamic_output_shape() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1, 1, 4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 36, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {0, 0, 0, 0}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {0, 1}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 64, 1 |
| }; |
| const std::vector<hidl_memory> pools = {}; |
| |
| return { |
| .operands = operands, |
| .operations = operations, |
| .inputIndexes = inputIndexes, |
| .outputIndexes = outputIndexes, |
| .operandValues = operandValues, |
| .pools = pools, |
| .relaxComputationFloat32toFloat16 = true, |
| }; |
| } |
| |
| bool is_ignored_nchw_relaxed_dynamic_output_shape(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nchw_relaxed_all_inputs_as_internal() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1, 1, 4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 36, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 1, 2, 2}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1, 1, 4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 37, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 41, .length = 4}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 45, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 49, .length = 4}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ADD, |
| .inputs = {9, 10, 11}, |
| .outputs = {0}, |
| }, |
| { |
| .type = OperationType::ADD, |
| .inputs = {12, 13, 14}, |
| .outputs = {1}, |
| }, |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {9, 12}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 64, 1, 0, 0, 0, 0, 0, 0, 0, 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, |
| .relaxComputationFloat32toFloat16 = true, |
| }; |
| } |
| |
| bool is_ignored_nchw_relaxed_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::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nchw_relaxed_all_inputs_as_internal_dynamic_output_shape() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1, 1, 4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 36, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {0, 0, 0, 0}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1, 1, 4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 37, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 41, .length = 4}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 45, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 49, .length = 4}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ADD, |
| .inputs = {9, 10, 11}, |
| .outputs = {0}, |
| }, |
| { |
| .type = OperationType::ADD, |
| .inputs = {12, 13, 14}, |
| .outputs = {1}, |
| }, |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {9, 12}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 64, 1, 0, 0, 0, 0, 0, 0, 0, 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, |
| .relaxComputationFloat32toFloat16 = true, |
| }; |
| } |
| |
| bool is_ignored_nchw_relaxed_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::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nchw_quant8() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {1, 1, 4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.25f, |
| .zeroPoint = 128, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT16_ASYMM, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.125f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 36, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {5, 1, 2, 2}, |
| .numberOfConsumers = 0, |
| .scale = 0.25f, |
| .zeroPoint = 128, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {0, 1}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 64, 1 |
| }; |
| const std::vector<hidl_memory> pools = {}; |
| |
| return { |
| .operands = operands, |
| .operations = operations, |
| .inputIndexes = inputIndexes, |
| .outputIndexes = outputIndexes, |
| .operandValues = operandValues, |
| .pools = pools, |
| }; |
| } |
| |
| bool is_ignored_nchw_quant8(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nchw_quant8_dynamic_output_shape() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {1, 1, 4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.25f, |
| .zeroPoint = 128, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT16_ASYMM, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.125f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 36, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {0, 0, 0, 0}, |
| .numberOfConsumers = 0, |
| .scale = 0.25f, |
| .zeroPoint = 128, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {0, 1}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 64, 1 |
| }; |
| const std::vector<hidl_memory> pools = {}; |
| |
| return { |
| .operands = operands, |
| .operations = operations, |
| .inputIndexes = inputIndexes, |
| .outputIndexes = outputIndexes, |
| .operandValues = operandValues, |
| .pools = pools, |
| }; |
| } |
| |
| bool is_ignored_nchw_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::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nchw_quant8_all_inputs_as_internal() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {1, 1, 4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.25f, |
| .zeroPoint = 128, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT16_ASYMM, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.125f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 36, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {5, 1, 2, 2}, |
| .numberOfConsumers = 0, |
| .scale = 0.25f, |
| .zeroPoint = 128, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {1, 1, 4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.25f, |
| .zeroPoint = 128, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.25f, |
| .zeroPoint = 128, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 37, .length = 1}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 38, .length = 4}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ADD, |
| .inputs = {9, 10, 11}, |
| .outputs = {0}, |
| }, |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {1, 9}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 64, 1, 128, 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_nchw_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::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nchw_quant8_all_inputs_as_internal_dynamic_output_shape() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {1, 1, 4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.25f, |
| .zeroPoint = 128, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT16_ASYMM, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.125f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 36, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {0, 0, 0, 0}, |
| .numberOfConsumers = 0, |
| .scale = 0.25f, |
| .zeroPoint = 128, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {1, 1, 4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.25f, |
| .zeroPoint = 128, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.25f, |
| .zeroPoint = 128, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 37, .length = 1}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 38, .length = 4}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ADD, |
| .inputs = {9, 10, 11}, |
| .outputs = {0}, |
| }, |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {1, 9}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 64, 1, 128, 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_nchw_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::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nchw_float16() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {1, 1, 4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT16, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 2}, |
| }, |
| { |
| .type = OperandType::FLOAT16, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 30, .length = 2}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {5, 1, 2, 2}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {0, 1}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 64, 0, 64, 1 |
| }; |
| const std::vector<hidl_memory> pools = {}; |
| |
| return { |
| .operands = operands, |
| .operations = operations, |
| .inputIndexes = inputIndexes, |
| .outputIndexes = outputIndexes, |
| .operandValues = operandValues, |
| .pools = pools, |
| }; |
| } |
| |
| bool is_ignored_nchw_float16(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nchw_float16_dynamic_output_shape() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {1, 1, 4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT16, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 2}, |
| }, |
| { |
| .type = OperandType::FLOAT16, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 30, .length = 2}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {0, 0, 0, 0}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {0, 1}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 64, 0, 64, 1 |
| }; |
| const std::vector<hidl_memory> pools = {}; |
| |
| return { |
| .operands = operands, |
| .operations = operations, |
| .inputIndexes = inputIndexes, |
| .outputIndexes = outputIndexes, |
| .operandValues = operandValues, |
| .pools = pools, |
| }; |
| } |
| |
| bool is_ignored_nchw_float16_dynamic_output_shape(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nchw_float16_all_inputs_as_internal() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {1, 1, 4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT16, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 2}, |
| }, |
| { |
| .type = OperandType::FLOAT16, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 30, .length = 2}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {5, 1, 2, 2}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {1, 1, 4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 33, .length = 2}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 35, .length = 4}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 39, .length = 2}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 41, .length = 4}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ADD, |
| .inputs = {9, 10, 11}, |
| .outputs = {0}, |
| }, |
| { |
| .type = OperationType::ADD, |
| .inputs = {12, 13, 14}, |
| .outputs = {1}, |
| }, |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {9, 12}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 64, 0, 64, 1, 0, 0, 0, 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_nchw_float16_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::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nchw_float16_all_inputs_as_internal_dynamic_output_shape() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {1, 1, 4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT16, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 2}, |
| }, |
| { |
| .type = OperandType::FLOAT16, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 30, .length = 2}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {0, 0, 0, 0}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {1, 1, 4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 33, .length = 2}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 35, .length = 4}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 39, .length = 2}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 41, .length = 4}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ADD, |
| .inputs = {9, 10, 11}, |
| .outputs = {0}, |
| }, |
| { |
| .type = OperationType::ADD, |
| .inputs = {12, 13, 14}, |
| .outputs = {1}, |
| }, |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {9, 12}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 64, 0, 64, 1, 0, 0, 0, 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_nchw_float16_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::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nhwc_2() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 4, 8, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 16}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 16, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 2, 3, 2}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {0, 1}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 128, 64, 0, 0, 128, 64, 0 |
| }; |
| const std::vector<hidl_memory> pools = {}; |
| |
| return { |
| .operands = operands, |
| .operations = operations, |
| .inputIndexes = inputIndexes, |
| .outputIndexes = outputIndexes, |
| .operandValues = operandValues, |
| .pools = pools, |
| }; |
| } |
| |
| bool is_ignored_nhwc_2(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nhwc_dynamic_output_shape_2() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 4, 8, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 16}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 16, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {0, 0, 0, 0}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {0, 1}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 128, 64, 0, 0, 128, 64, 0 |
| }; |
| const std::vector<hidl_memory> pools = {}; |
| |
| return { |
| .operands = operands, |
| .operations = operations, |
| .inputIndexes = inputIndexes, |
| .outputIndexes = outputIndexes, |
| .operandValues = operandValues, |
| .pools = pools, |
| }; |
| } |
| |
| bool is_ignored_nhwc_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::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nhwc_all_inputs_as_internal_2() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 4, 8, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 16}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 16, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 2, 3, 2}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 4, 8, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 33, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 37, .length = 4}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 41, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 45, .length = 4}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ADD, |
| .inputs = {9, 10, 11}, |
| .outputs = {0}, |
| }, |
| { |
| .type = OperationType::ADD, |
| .inputs = {12, 13, 14}, |
| .outputs = {1}, |
| }, |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {9, 12}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 128, 64, 0, 0, 128, 64, 0, 0, 0, 0, 0, 0, 0, 0, 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_nhwc_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::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nhwc_all_inputs_as_internal_dynamic_output_shape_2() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 4, 8, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 16}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 16, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {0, 0, 0, 0}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 4, 8, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 33, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 37, .length = 4}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 41, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 45, .length = 4}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ADD, |
| .inputs = {9, 10, 11}, |
| .outputs = {0}, |
| }, |
| { |
| .type = OperationType::ADD, |
| .inputs = {12, 13, 14}, |
| .outputs = {1}, |
| }, |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {9, 12}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 128, 64, 0, 0, 128, 64, 0, 0, 0, 0, 0, 0, 0, 0, 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_nhwc_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::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nhwc_relaxed_2() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 4, 8, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 16}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 16, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 2, 3, 2}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {0, 1}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 128, 64, 0, 0, 128, 64, 0 |
| }; |
| const std::vector<hidl_memory> pools = {}; |
| |
| return { |
| .operands = operands, |
| .operations = operations, |
| .inputIndexes = inputIndexes, |
| .outputIndexes = outputIndexes, |
| .operandValues = operandValues, |
| .pools = pools, |
| .relaxComputationFloat32toFloat16 = true, |
| }; |
| } |
| |
| bool is_ignored_nhwc_relaxed_2(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nhwc_relaxed_dynamic_output_shape_2() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 4, 8, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 16}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 16, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {0, 0, 0, 0}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {0, 1}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 128, 64, 0, 0, 128, 64, 0 |
| }; |
| const std::vector<hidl_memory> pools = {}; |
| |
| return { |
| .operands = operands, |
| .operations = operations, |
| .inputIndexes = inputIndexes, |
| .outputIndexes = outputIndexes, |
| .operandValues = operandValues, |
| .pools = pools, |
| .relaxComputationFloat32toFloat16 = true, |
| }; |
| } |
| |
| bool is_ignored_nhwc_relaxed_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::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nhwc_relaxed_all_inputs_as_internal_2() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 4, 8, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 16}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 16, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 2, 3, 2}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 4, 8, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 33, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 37, .length = 4}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 41, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 45, .length = 4}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ADD, |
| .inputs = {9, 10, 11}, |
| .outputs = {0}, |
| }, |
| { |
| .type = OperationType::ADD, |
| .inputs = {12, 13, 14}, |
| .outputs = {1}, |
| }, |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {9, 12}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 128, 64, 0, 0, 128, 64, 0, 0, 0, 0, 0, 0, 0, 0, 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, |
| .relaxComputationFloat32toFloat16 = true, |
| }; |
| } |
| |
| bool is_ignored_nhwc_relaxed_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::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nhwc_relaxed_all_inputs_as_internal_dynamic_output_shape_2() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 4, 8, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 16}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 16, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {0, 0, 0, 0}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 4, 8, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 33, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 37, .length = 4}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 41, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 45, .length = 4}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ADD, |
| .inputs = {9, 10, 11}, |
| .outputs = {0}, |
| }, |
| { |
| .type = OperationType::ADD, |
| .inputs = {12, 13, 14}, |
| .outputs = {1}, |
| }, |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {9, 12}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 128, 64, 0, 0, 128, 64, 0, 0, 0, 0, 0, 0, 0, 0, 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, |
| .relaxComputationFloat32toFloat16 = true, |
| }; |
| } |
| |
| bool is_ignored_nhwc_relaxed_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::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nhwc_quant8_2() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {4, 4, 8, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.04f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT16_ASYMM, |
| .dimensions = {4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.125f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 16}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 16, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {4, 2, 3, 2}, |
| .numberOfConsumers = 0, |
| .scale = 0.04f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {0, 1}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 128, 64, 0, 0, 128, 64, 0 |
| }; |
| const std::vector<hidl_memory> pools = {}; |
| |
| return { |
| .operands = operands, |
| .operations = operations, |
| .inputIndexes = inputIndexes, |
| .outputIndexes = outputIndexes, |
| .operandValues = operandValues, |
| .pools = pools, |
| }; |
| } |
| |
| bool is_ignored_nhwc_quant8_2(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nhwc_quant8_dynamic_output_shape_2() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {4, 4, 8, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.04f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT16_ASYMM, |
| .dimensions = {4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.125f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 16}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 16, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {0, 0, 0, 0}, |
| .numberOfConsumers = 0, |
| .scale = 0.04f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {0, 1}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 128, 64, 0, 0, 128, 64, 0 |
| }; |
| const std::vector<hidl_memory> pools = {}; |
| |
| return { |
| .operands = operands, |
| .operations = operations, |
| .inputIndexes = inputIndexes, |
| .outputIndexes = outputIndexes, |
| .operandValues = operandValues, |
| .pools = pools, |
| }; |
| } |
| |
| bool is_ignored_nhwc_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::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nhwc_quant8_all_inputs_as_internal_2() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {4, 4, 8, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.04f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT16_ASYMM, |
| .dimensions = {4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.125f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 16}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 16, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {4, 2, 3, 2}, |
| .numberOfConsumers = 0, |
| .scale = 0.04f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {4, 4, 8, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.04f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.04f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 33, .length = 1}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 34, .length = 4}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ADD, |
| .inputs = {9, 10, 11}, |
| .outputs = {0}, |
| }, |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {1, 9}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 128, 64, 0, 0, 128, 64, 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_nhwc_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::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nhwc_quant8_all_inputs_as_internal_dynamic_output_shape_2() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {4, 4, 8, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.04f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT16_ASYMM, |
| .dimensions = {4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.125f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 16}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 16, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {0, 0, 0, 0}, |
| .numberOfConsumers = 0, |
| .scale = 0.04f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {4, 4, 8, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.04f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.04f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 33, .length = 1}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 34, .length = 4}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ADD, |
| .inputs = {9, 10, 11}, |
| .outputs = {0}, |
| }, |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {1, 9}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 128, 64, 0, 0, 128, 64, 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_nhwc_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::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nhwc_float16_2() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {4, 4, 8, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 16}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 16, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT16, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 2}, |
| }, |
| { |
| .type = OperandType::FLOAT16, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 26, .length = 2}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {4, 2, 3, 2}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {0, 1}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 68, 0, 68, 0 |
| }; |
| const std::vector<hidl_memory> pools = {}; |
| |
| return { |
| .operands = operands, |
| .operations = operations, |
| .inputIndexes = inputIndexes, |
| .outputIndexes = outputIndexes, |
| .operandValues = operandValues, |
| .pools = pools, |
| }; |
| } |
| |
| bool is_ignored_nhwc_float16_2(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nhwc_float16_dynamic_output_shape_2() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {4, 4, 8, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 16}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 16, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT16, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 2}, |
| }, |
| { |
| .type = OperandType::FLOAT16, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 26, .length = 2}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {0, 0, 0, 0}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {0, 1}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 68, 0, 68, 0 |
| }; |
| const std::vector<hidl_memory> pools = {}; |
| |
| return { |
| .operands = operands, |
| .operations = operations, |
| .inputIndexes = inputIndexes, |
| .outputIndexes = outputIndexes, |
| .operandValues = operandValues, |
| .pools = pools, |
| }; |
| } |
| |
| bool is_ignored_nhwc_float16_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::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nhwc_float16_all_inputs_as_internal_2() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {4, 4, 8, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 16}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 16, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT16, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 2}, |
| }, |
| { |
| .type = OperandType::FLOAT16, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 26, .length = 2}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {4, 2, 3, 2}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {4, 4, 8, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 29, .length = 2}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 31, .length = 4}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 35, .length = 2}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 37, .length = 4}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ADD, |
| .inputs = {9, 10, 11}, |
| .outputs = {0}, |
| }, |
| { |
| .type = OperationType::ADD, |
| .inputs = {12, 13, 14}, |
| .outputs = {1}, |
| }, |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {9, 12}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 68, 0, 68, 0, 0, 0, 0, 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_nhwc_float16_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::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nhwc_float16_all_inputs_as_internal_dynamic_output_shape_2() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {4, 4, 8, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 16}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 16, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT16, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 2}, |
| }, |
| { |
| .type = OperandType::FLOAT16, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 26, .length = 2}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {0, 0, 0, 0}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {4, 4, 8, 2}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 29, .length = 2}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 31, .length = 4}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 35, .length = 2}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 37, .length = 4}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ADD, |
| .inputs = {9, 10, 11}, |
| .outputs = {0}, |
| }, |
| { |
| .type = OperationType::ADD, |
| .inputs = {12, 13, 14}, |
| .outputs = {1}, |
| }, |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {9, 12}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 68, 0, 68, 0, 0, 0, 0, 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_nhwc_float16_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::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nchw_2() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 2, 4, 8}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 16}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 16, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 2, 2, 3}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {0, 1}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 128, 64, 0, 0, 128, 64, 1 |
| }; |
| const std::vector<hidl_memory> pools = {}; |
| |
| return { |
| .operands = operands, |
| .operations = operations, |
| .inputIndexes = inputIndexes, |
| .outputIndexes = outputIndexes, |
| .operandValues = operandValues, |
| .pools = pools, |
| }; |
| } |
| |
| bool is_ignored_nchw_2(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nchw_dynamic_output_shape_2() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 2, 4, 8}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 16}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 16, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {0, 0, 0, 0}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {0, 1}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 128, 64, 0, 0, 128, 64, 1 |
| }; |
| const std::vector<hidl_memory> pools = {}; |
| |
| return { |
| .operands = operands, |
| .operations = operations, |
| .inputIndexes = inputIndexes, |
| .outputIndexes = outputIndexes, |
| .operandValues = operandValues, |
| .pools = pools, |
| }; |
| } |
| |
| bool is_ignored_nchw_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::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nchw_all_inputs_as_internal_2() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 2, 4, 8}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 16}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 16, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 2, 2, 3}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 2, 4, 8}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 33, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 37, .length = 4}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 41, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 45, .length = 4}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ADD, |
| .inputs = {9, 10, 11}, |
| .outputs = {0}, |
| }, |
| { |
| .type = OperationType::ADD, |
| .inputs = {12, 13, 14}, |
| .outputs = {1}, |
| }, |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {9, 12}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 128, 64, 0, 0, 128, 64, 1, 0, 0, 0, 0, 0, 0, 0, 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_nchw_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::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nchw_all_inputs_as_internal_dynamic_output_shape_2() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 2, 4, 8}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 16}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 16, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {0, 0, 0, 0}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 2, 4, 8}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 33, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 37, .length = 4}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 41, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 45, .length = 4}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ADD, |
| .inputs = {9, 10, 11}, |
| .outputs = {0}, |
| }, |
| { |
| .type = OperationType::ADD, |
| .inputs = {12, 13, 14}, |
| .outputs = {1}, |
| }, |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {9, 12}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 128, 64, 0, 0, 128, 64, 1, 0, 0, 0, 0, 0, 0, 0, 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_nchw_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::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nchw_relaxed_2() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 2, 4, 8}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 16}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 16, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 2, 2, 3}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {0, 1}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 128, 64, 0, 0, 128, 64, 1 |
| }; |
| const std::vector<hidl_memory> pools = {}; |
| |
| return { |
| .operands = operands, |
| .operations = operations, |
| .inputIndexes = inputIndexes, |
| .outputIndexes = outputIndexes, |
| .operandValues = operandValues, |
| .pools = pools, |
| .relaxComputationFloat32toFloat16 = true, |
| }; |
| } |
| |
| bool is_ignored_nchw_relaxed_2(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nchw_relaxed_dynamic_output_shape_2() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 2, 4, 8}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 16}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 16, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {0, 0, 0, 0}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {0, 1}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 128, 64, 0, 0, 128, 64, 1 |
| }; |
| const std::vector<hidl_memory> pools = {}; |
| |
| return { |
| .operands = operands, |
| .operations = operations, |
| .inputIndexes = inputIndexes, |
| .outputIndexes = outputIndexes, |
| .operandValues = operandValues, |
| .pools = pools, |
| .relaxComputationFloat32toFloat16 = true, |
| }; |
| } |
| |
| bool is_ignored_nchw_relaxed_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::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nchw_relaxed_all_inputs_as_internal_2() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 2, 4, 8}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 16}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 16, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 2, 2, 3}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 2, 4, 8}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 33, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 37, .length = 4}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 41, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 45, .length = 4}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ADD, |
| .inputs = {9, 10, 11}, |
| .outputs = {0}, |
| }, |
| { |
| .type = OperationType::ADD, |
| .inputs = {12, 13, 14}, |
| .outputs = {1}, |
| }, |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {9, 12}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 128, 64, 0, 0, 128, 64, 1, 0, 0, 0, 0, 0, 0, 0, 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, |
| .relaxComputationFloat32toFloat16 = true, |
| }; |
| } |
| |
| bool is_ignored_nchw_relaxed_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::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nchw_relaxed_all_inputs_as_internal_dynamic_output_shape_2() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 2, 4, 8}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 16}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 16, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {0, 0, 0, 0}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 2, 4, 8}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 33, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 37, .length = 4}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 41, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 45, .length = 4}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ADD, |
| .inputs = {9, 10, 11}, |
| .outputs = {0}, |
| }, |
| { |
| .type = OperationType::ADD, |
| .inputs = {12, 13, 14}, |
| .outputs = {1}, |
| }, |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {9, 12}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 128, 64, 0, 0, 128, 64, 1, 0, 0, 0, 0, 0, 0, 0, 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, |
| .relaxComputationFloat32toFloat16 = true, |
| }; |
| } |
| |
| bool is_ignored_nchw_relaxed_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::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nchw_quant8_2() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {4, 2, 4, 8}, |
| .numberOfConsumers = 1, |
| .scale = 0.04f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT16_ASYMM, |
| .dimensions = {4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.125f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 16}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 16, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {4, 2, 2, 3}, |
| .numberOfConsumers = 0, |
| .scale = 0.04f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {0, 1}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 128, 64, 0, 0, 128, 64, 1 |
| }; |
| const std::vector<hidl_memory> pools = {}; |
| |
| return { |
| .operands = operands, |
| .operations = operations, |
| .inputIndexes = inputIndexes, |
| .outputIndexes = outputIndexes, |
| .operandValues = operandValues, |
| .pools = pools, |
| }; |
| } |
| |
| bool is_ignored_nchw_quant8_2(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nchw_quant8_dynamic_output_shape_2() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {4, 2, 4, 8}, |
| .numberOfConsumers = 1, |
| .scale = 0.04f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT16_ASYMM, |
| .dimensions = {4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.125f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 16}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 16, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {0, 0, 0, 0}, |
| .numberOfConsumers = 0, |
| .scale = 0.04f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {0, 1}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 128, 64, 0, 0, 128, 64, 1 |
| }; |
| const std::vector<hidl_memory> pools = {}; |
| |
| return { |
| .operands = operands, |
| .operations = operations, |
| .inputIndexes = inputIndexes, |
| .outputIndexes = outputIndexes, |
| .operandValues = operandValues, |
| .pools = pools, |
| }; |
| } |
| |
| bool is_ignored_nchw_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::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nchw_quant8_all_inputs_as_internal_2() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {4, 2, 4, 8}, |
| .numberOfConsumers = 1, |
| .scale = 0.04f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT16_ASYMM, |
| .dimensions = {4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.125f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 16}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 16, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {4, 2, 2, 3}, |
| .numberOfConsumers = 0, |
| .scale = 0.04f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {4, 2, 4, 8}, |
| .numberOfConsumers = 1, |
| .scale = 0.04f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.04f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 33, .length = 1}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 34, .length = 4}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ADD, |
| .inputs = {9, 10, 11}, |
| .outputs = {0}, |
| }, |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {1, 9}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 128, 64, 0, 0, 128, 64, 1, 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_nchw_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::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nchw_quant8_all_inputs_as_internal_dynamic_output_shape_2() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {4, 2, 4, 8}, |
| .numberOfConsumers = 1, |
| .scale = 0.04f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT16_ASYMM, |
| .dimensions = {4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.125f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 16}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 16, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {0, 0, 0, 0}, |
| .numberOfConsumers = 0, |
| .scale = 0.04f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {4, 2, 4, 8}, |
| .numberOfConsumers = 1, |
| .scale = 0.04f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.04f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 33, .length = 1}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 34, .length = 4}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ADD, |
| .inputs = {9, 10, 11}, |
| .outputs = {0}, |
| }, |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {1, 9}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 128, 64, 0, 0, 128, 64, 1, 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_nchw_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::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nchw_float16_2() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {4, 2, 4, 8}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 16}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 16, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT16, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 2}, |
| }, |
| { |
| .type = OperandType::FLOAT16, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 26, .length = 2}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {4, 2, 2, 3}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {0, 1}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 68, 0, 68, 1 |
| }; |
| const std::vector<hidl_memory> pools = {}; |
| |
| return { |
| .operands = operands, |
| .operations = operations, |
| .inputIndexes = inputIndexes, |
| .outputIndexes = outputIndexes, |
| .operandValues = operandValues, |
| .pools = pools, |
| }; |
| } |
| |
| bool is_ignored_nchw_float16_2(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nchw_float16_dynamic_output_shape_2() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {4, 2, 4, 8}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 16}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 16, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT16, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 2}, |
| }, |
| { |
| .type = OperandType::FLOAT16, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 26, .length = 2}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {0, 0, 0, 0}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {0, 1}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 68, 0, 68, 1 |
| }; |
| const std::vector<hidl_memory> pools = {}; |
| |
| return { |
| .operands = operands, |
| .operations = operations, |
| .inputIndexes = inputIndexes, |
| .outputIndexes = outputIndexes, |
| .operandValues = operandValues, |
| .pools = pools, |
| }; |
| } |
| |
| bool is_ignored_nchw_float16_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::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nchw_float16_all_inputs_as_internal_2() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {4, 2, 4, 8}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 16}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 16, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT16, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 2}, |
| }, |
| { |
| .type = OperandType::FLOAT16, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 26, .length = 2}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {4, 2, 2, 3}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {4, 2, 4, 8}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 29, .length = 2}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 31, .length = 4}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 35, .length = 2}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 37, .length = 4}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ADD, |
| .inputs = {9, 10, 11}, |
| .outputs = {0}, |
| }, |
| { |
| .type = OperationType::ADD, |
| .inputs = {12, 13, 14}, |
| .outputs = {1}, |
| }, |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {9, 12}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 68, 0, 68, 1, 0, 0, 0, 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_nchw_float16_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::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nchw_float16_all_inputs_as_internal_dynamic_output_shape_2() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {4, 2, 4, 8}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 16}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 16, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT16, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 2}, |
| }, |
| { |
| .type = OperandType::FLOAT16, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 26, .length = 2}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {0, 0, 0, 0}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {4, 2, 4, 8}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 29, .length = 2}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 31, .length = 4}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 35, .length = 2}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 37, .length = 4}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ADD, |
| .inputs = {9, 10, 11}, |
| .outputs = {0}, |
| }, |
| { |
| .type = OperationType::ADD, |
| .inputs = {12, 13, 14}, |
| .outputs = {1}, |
| }, |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {9, 12}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 68, 0, 68, 1, 0, 0, 0, 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_nchw_float16_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::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nhwc_3() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 4, 4, 1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 36, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 2, 2, 1}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {0, 1}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 128, 63, 0 |
| }; |
| const std::vector<hidl_memory> pools = {}; |
| |
| return { |
| .operands = operands, |
| .operations = operations, |
| .inputIndexes = inputIndexes, |
| .outputIndexes = outputIndexes, |
| .operandValues = operandValues, |
| .pools = pools, |
| }; |
| } |
| |
| bool is_ignored_nhwc_3(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nhwc_dynamic_output_shape_3() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 4, 4, 1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 36, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {0, 0, 0, 0}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {0, 1}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 128, 63, 0 |
| }; |
| const std::vector<hidl_memory> pools = {}; |
| |
| return { |
| .operands = operands, |
| .operations = operations, |
| .inputIndexes = inputIndexes, |
| .outputIndexes = outputIndexes, |
| .operandValues = operandValues, |
| .pools = pools, |
| }; |
| } |
| |
| bool is_ignored_nhwc_dynamic_output_shape_3(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nhwc_all_inputs_as_internal_3() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 4, 4, 1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 36, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 2, 2, 1}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 4, 4, 1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 37, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 41, .length = 4}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 45, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 49, .length = 4}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ADD, |
| .inputs = {9, 10, 11}, |
| .outputs = {0}, |
| }, |
| { |
| .type = OperationType::ADD, |
| .inputs = {12, 13, 14}, |
| .outputs = {1}, |
| }, |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {9, 12}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 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_nhwc_all_inputs_as_internal_3(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nhwc_all_inputs_as_internal_dynamic_output_shape_3() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 4, 4, 1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 36, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {0, 0, 0, 0}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 4, 4, 1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 37, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 41, .length = 4}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 45, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 49, .length = 4}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ADD, |
| .inputs = {9, 10, 11}, |
| .outputs = {0}, |
| }, |
| { |
| .type = OperationType::ADD, |
| .inputs = {12, 13, 14}, |
| .outputs = {1}, |
| }, |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {9, 12}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 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_nhwc_all_inputs_as_internal_dynamic_output_shape_3(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nhwc_relaxed_3() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 4, 4, 1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 36, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 2, 2, 1}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {0, 1}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 128, 63, 0 |
| }; |
| const std::vector<hidl_memory> pools = {}; |
| |
| return { |
| .operands = operands, |
| .operations = operations, |
| .inputIndexes = inputIndexes, |
| .outputIndexes = outputIndexes, |
| .operandValues = operandValues, |
| .pools = pools, |
| .relaxComputationFloat32toFloat16 = true, |
| }; |
| } |
| |
| bool is_ignored_nhwc_relaxed_3(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nhwc_relaxed_dynamic_output_shape_3() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 4, 4, 1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 36, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {0, 0, 0, 0}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {0, 1}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 128, 63, 0 |
| }; |
| const std::vector<hidl_memory> pools = {}; |
| |
| return { |
| .operands = operands, |
| .operations = operations, |
| .inputIndexes = inputIndexes, |
| .outputIndexes = outputIndexes, |
| .operandValues = operandValues, |
| .pools = pools, |
| .relaxComputationFloat32toFloat16 = true, |
| }; |
| } |
| |
| bool is_ignored_nhwc_relaxed_dynamic_output_shape_3(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nhwc_relaxed_all_inputs_as_internal_3() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 4, 4, 1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 36, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 2, 2, 1}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 4, 4, 1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 37, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 41, .length = 4}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 45, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 49, .length = 4}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ADD, |
| .inputs = {9, 10, 11}, |
| .outputs = {0}, |
| }, |
| { |
| .type = OperationType::ADD, |
| .inputs = {12, 13, 14}, |
| .outputs = {1}, |
| }, |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {9, 12}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 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, |
| .relaxComputationFloat32toFloat16 = true, |
| }; |
| } |
| |
| bool is_ignored_nhwc_relaxed_all_inputs_as_internal_3(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nhwc_relaxed_all_inputs_as_internal_dynamic_output_shape_3() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 4, 4, 1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 36, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {0, 0, 0, 0}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 4, 4, 1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 37, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 41, .length = 4}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 45, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 49, .length = 4}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ADD, |
| .inputs = {9, 10, 11}, |
| .outputs = {0}, |
| }, |
| { |
| .type = OperationType::ADD, |
| .inputs = {12, 13, 14}, |
| .outputs = {1}, |
| }, |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {9, 12}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 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, |
| .relaxComputationFloat32toFloat16 = true, |
| }; |
| } |
| |
| bool is_ignored_nhwc_relaxed_all_inputs_as_internal_dynamic_output_shape_3(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nhwc_quant8_3() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {4, 4, 4, 1}, |
| .numberOfConsumers = 1, |
| .scale = 0.25f, |
| .zeroPoint = 128, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT16_ASYMM, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.125f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 36, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {5, 2, 2, 1}, |
| .numberOfConsumers = 0, |
| .scale = 0.25f, |
| .zeroPoint = 128, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {0, 1}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 128, 63, 0 |
| }; |
| const std::vector<hidl_memory> pools = {}; |
| |
| return { |
| .operands = operands, |
| .operations = operations, |
| .inputIndexes = inputIndexes, |
| .outputIndexes = outputIndexes, |
| .operandValues = operandValues, |
| .pools = pools, |
| }; |
| } |
| |
| bool is_ignored_nhwc_quant8_3(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nhwc_quant8_dynamic_output_shape_3() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {4, 4, 4, 1}, |
| .numberOfConsumers = 1, |
| .scale = 0.25f, |
| .zeroPoint = 128, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT16_ASYMM, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.125f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 36, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {0, 0, 0, 0}, |
| .numberOfConsumers = 0, |
| .scale = 0.25f, |
| .zeroPoint = 128, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {0, 1}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 128, 63, 0 |
| }; |
| const std::vector<hidl_memory> pools = {}; |
| |
| return { |
| .operands = operands, |
| .operations = operations, |
| .inputIndexes = inputIndexes, |
| .outputIndexes = outputIndexes, |
| .operandValues = operandValues, |
| .pools = pools, |
| }; |
| } |
| |
| bool is_ignored_nhwc_quant8_dynamic_output_shape_3(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nhwc_quant8_all_inputs_as_internal_3() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {4, 4, 4, 1}, |
| .numberOfConsumers = 1, |
| .scale = 0.25f, |
| .zeroPoint = 128, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT16_ASYMM, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.125f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 36, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {5, 2, 2, 1}, |
| .numberOfConsumers = 0, |
| .scale = 0.25f, |
| .zeroPoint = 128, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {4, 4, 4, 1}, |
| .numberOfConsumers = 1, |
| .scale = 0.25f, |
| .zeroPoint = 128, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.25f, |
| .zeroPoint = 128, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 37, .length = 1}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 38, .length = 4}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ADD, |
| .inputs = {9, 10, 11}, |
| .outputs = {0}, |
| }, |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {1, 9}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 128, 63, 0, 128, 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_nhwc_quant8_all_inputs_as_internal_3(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nhwc_quant8_all_inputs_as_internal_dynamic_output_shape_3() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {4, 4, 4, 1}, |
| .numberOfConsumers = 1, |
| .scale = 0.25f, |
| .zeroPoint = 128, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT16_ASYMM, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.125f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 36, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {0, 0, 0, 0}, |
| .numberOfConsumers = 0, |
| .scale = 0.25f, |
| .zeroPoint = 128, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {4, 4, 4, 1}, |
| .numberOfConsumers = 1, |
| .scale = 0.25f, |
| .zeroPoint = 128, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.25f, |
| .zeroPoint = 128, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 37, .length = 1}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 38, .length = 4}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ADD, |
| .inputs = {9, 10, 11}, |
| .outputs = {0}, |
| }, |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {1, 9}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 128, 63, 0, 128, 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_nhwc_quant8_all_inputs_as_internal_dynamic_output_shape_3(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nhwc_float16_3() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {4, 4, 4, 1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT16, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 2}, |
| }, |
| { |
| .type = OperandType::FLOAT16, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 30, .length = 2}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {5, 2, 2, 1}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {0, 1}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 64, 0, 60, 0 |
| }; |
| const std::vector<hidl_memory> pools = {}; |
| |
| return { |
| .operands = operands, |
| .operations = operations, |
| .inputIndexes = inputIndexes, |
| .outputIndexes = outputIndexes, |
| .operandValues = operandValues, |
| .pools = pools, |
| }; |
| } |
| |
| bool is_ignored_nhwc_float16_3(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nhwc_float16_dynamic_output_shape_3() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {4, 4, 4, 1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT16, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 2}, |
| }, |
| { |
| .type = OperandType::FLOAT16, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 30, .length = 2}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {0, 0, 0, 0}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {0, 1}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 64, 0, 60, 0 |
| }; |
| const std::vector<hidl_memory> pools = {}; |
| |
| return { |
| .operands = operands, |
| .operations = operations, |
| .inputIndexes = inputIndexes, |
| .outputIndexes = outputIndexes, |
| .operandValues = operandValues, |
| .pools = pools, |
| }; |
| } |
| |
| bool is_ignored_nhwc_float16_dynamic_output_shape_3(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nhwc_float16_all_inputs_as_internal_3() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {4, 4, 4, 1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT16, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 2}, |
| }, |
| { |
| .type = OperandType::FLOAT16, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 30, .length = 2}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {5, 2, 2, 1}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {4, 4, 4, 1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 33, .length = 2}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 35, .length = 4}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 39, .length = 2}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 41, .length = 4}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ADD, |
| .inputs = {9, 10, 11}, |
| .outputs = {0}, |
| }, |
| { |
| .type = OperationType::ADD, |
| .inputs = {12, 13, 14}, |
| .outputs = {1}, |
| }, |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {9, 12}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 64, 0, 60, 0, 0, 0, 0, 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_nhwc_float16_all_inputs_as_internal_3(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nhwc_float16_all_inputs_as_internal_dynamic_output_shape_3() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {4, 4, 4, 1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT16, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 2}, |
| }, |
| { |
| .type = OperandType::FLOAT16, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 30, .length = 2}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {0, 0, 0, 0}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {4, 4, 4, 1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 33, .length = 2}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 35, .length = 4}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 39, .length = 2}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 41, .length = 4}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ADD, |
| .inputs = {9, 10, 11}, |
| .outputs = {0}, |
| }, |
| { |
| .type = OperationType::ADD, |
| .inputs = {12, 13, 14}, |
| .outputs = {1}, |
| }, |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {9, 12}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 64, 0, 60, 0, 0, 0, 0, 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_nhwc_float16_all_inputs_as_internal_dynamic_output_shape_3(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nchw_3() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 1, 4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 36, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 1, 2, 2}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {0, 1}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 128, 63, 1 |
| }; |
| const std::vector<hidl_memory> pools = {}; |
| |
| return { |
| .operands = operands, |
| .operations = operations, |
| .inputIndexes = inputIndexes, |
| .outputIndexes = outputIndexes, |
| .operandValues = operandValues, |
| .pools = pools, |
| }; |
| } |
| |
| bool is_ignored_nchw_3(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nchw_dynamic_output_shape_3() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 1, 4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 36, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {0, 0, 0, 0}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {0, 1}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 128, 63, 1 |
| }; |
| const std::vector<hidl_memory> pools = {}; |
| |
| return { |
| .operands = operands, |
| .operations = operations, |
| .inputIndexes = inputIndexes, |
| .outputIndexes = outputIndexes, |
| .operandValues = operandValues, |
| .pools = pools, |
| }; |
| } |
| |
| bool is_ignored_nchw_dynamic_output_shape_3(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nchw_all_inputs_as_internal_3() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 1, 4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 36, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 1, 2, 2}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 1, 4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 37, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 41, .length = 4}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 45, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 49, .length = 4}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ADD, |
| .inputs = {9, 10, 11}, |
| .outputs = {0}, |
| }, |
| { |
| .type = OperationType::ADD, |
| .inputs = {12, 13, 14}, |
| .outputs = {1}, |
| }, |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {9, 12}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 128, 63, 1, 0, 0, 0, 0, 0, 0, 0, 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_nchw_all_inputs_as_internal_3(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nchw_all_inputs_as_internal_dynamic_output_shape_3() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 1, 4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 36, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {0, 0, 0, 0}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 1, 4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 37, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 41, .length = 4}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 45, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 49, .length = 4}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ADD, |
| .inputs = {9, 10, 11}, |
| .outputs = {0}, |
| }, |
| { |
| .type = OperationType::ADD, |
| .inputs = {12, 13, 14}, |
| .outputs = {1}, |
| }, |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {9, 12}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 128, 63, 1, 0, 0, 0, 0, 0, 0, 0, 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_nchw_all_inputs_as_internal_dynamic_output_shape_3(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nchw_relaxed_3() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 1, 4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 36, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 1, 2, 2}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {0, 1}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 128, 63, 1 |
| }; |
| const std::vector<hidl_memory> pools = {}; |
| |
| return { |
| .operands = operands, |
| .operations = operations, |
| .inputIndexes = inputIndexes, |
| .outputIndexes = outputIndexes, |
| .operandValues = operandValues, |
| .pools = pools, |
| .relaxComputationFloat32toFloat16 = true, |
| }; |
| } |
| |
| bool is_ignored_nchw_relaxed_3(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nchw_relaxed_dynamic_output_shape_3() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 1, 4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 36, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {0, 0, 0, 0}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {0, 1}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 128, 63, 1 |
| }; |
| const std::vector<hidl_memory> pools = {}; |
| |
| return { |
| .operands = operands, |
| .operations = operations, |
| .inputIndexes = inputIndexes, |
| .outputIndexes = outputIndexes, |
| .operandValues = operandValues, |
| .pools = pools, |
| .relaxComputationFloat32toFloat16 = true, |
| }; |
| } |
| |
| bool is_ignored_nchw_relaxed_dynamic_output_shape_3(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nchw_relaxed_all_inputs_as_internal_3() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 1, 4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 36, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 1, 2, 2}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 1, 4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 37, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 41, .length = 4}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 45, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 49, .length = 4}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ADD, |
| .inputs = {9, 10, 11}, |
| .outputs = {0}, |
| }, |
| { |
| .type = OperationType::ADD, |
| .inputs = {12, 13, 14}, |
| .outputs = {1}, |
| }, |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {9, 12}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 128, 63, 1, 0, 0, 0, 0, 0, 0, 0, 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, |
| .relaxComputationFloat32toFloat16 = true, |
| }; |
| } |
| |
| bool is_ignored_nchw_relaxed_all_inputs_as_internal_3(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nchw_relaxed_all_inputs_as_internal_dynamic_output_shape_3() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 1, 4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 36, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {0, 0, 0, 0}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {4, 1, 4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 37, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 41, .length = 4}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT32, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 45, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 49, .length = 4}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ADD, |
| .inputs = {9, 10, 11}, |
| .outputs = {0}, |
| }, |
| { |
| .type = OperationType::ADD, |
| .inputs = {12, 13, 14}, |
| .outputs = {1}, |
| }, |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {9, 12}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 128, 63, 1, 0, 0, 0, 0, 0, 0, 0, 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, |
| .relaxComputationFloat32toFloat16 = true, |
| }; |
| } |
| |
| bool is_ignored_nchw_relaxed_all_inputs_as_internal_dynamic_output_shape_3(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nchw_quant8_3() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {4, 1, 4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.25f, |
| .zeroPoint = 128, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT16_ASYMM, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.125f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 36, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {5, 1, 2, 2}, |
| .numberOfConsumers = 0, |
| .scale = 0.25f, |
| .zeroPoint = 128, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {0, 1}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 128, 63, 1 |
| }; |
| const std::vector<hidl_memory> pools = {}; |
| |
| return { |
| .operands = operands, |
| .operations = operations, |
| .inputIndexes = inputIndexes, |
| .outputIndexes = outputIndexes, |
| .operandValues = operandValues, |
| .pools = pools, |
| }; |
| } |
| |
| bool is_ignored_nchw_quant8_3(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nchw_quant8_dynamic_output_shape_3() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {4, 1, 4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.25f, |
| .zeroPoint = 128, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT16_ASYMM, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.125f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 36, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {0, 0, 0, 0}, |
| .numberOfConsumers = 0, |
| .scale = 0.25f, |
| .zeroPoint = 128, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {0, 1}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 128, 63, 1 |
| }; |
| const std::vector<hidl_memory> pools = {}; |
| |
| return { |
| .operands = operands, |
| .operations = operations, |
| .inputIndexes = inputIndexes, |
| .outputIndexes = outputIndexes, |
| .operandValues = operandValues, |
| .pools = pools, |
| }; |
| } |
| |
| bool is_ignored_nchw_quant8_dynamic_output_shape_3(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nchw_quant8_all_inputs_as_internal_3() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {4, 1, 4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.25f, |
| .zeroPoint = 128, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT16_ASYMM, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.125f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 36, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {5, 1, 2, 2}, |
| .numberOfConsumers = 0, |
| .scale = 0.25f, |
| .zeroPoint = 128, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {4, 1, 4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.25f, |
| .zeroPoint = 128, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.25f, |
| .zeroPoint = 128, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 37, .length = 1}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 38, .length = 4}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ADD, |
| .inputs = {9, 10, 11}, |
| .outputs = {0}, |
| }, |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {1, 9}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 128, 63, 1, 128, 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_nchw_quant8_all_inputs_as_internal_3(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nchw_quant8_all_inputs_as_internal_dynamic_output_shape_3() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {4, 1, 4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.25f, |
| .zeroPoint = 128, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT16_ASYMM, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.125f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 4}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 36, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {0, 0, 0, 0}, |
| .numberOfConsumers = 0, |
| .scale = 0.25f, |
| .zeroPoint = 128, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {4, 1, 4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.25f, |
| .zeroPoint = 128, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_QUANT8_ASYMM, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.25f, |
| .zeroPoint = 128, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 37, .length = 1}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 38, .length = 4}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ADD, |
| .inputs = {9, 10, 11}, |
| .outputs = {0}, |
| }, |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {1, 9}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 128, 63, 1, 128, 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_nchw_quant8_all_inputs_as_internal_dynamic_output_shape_3(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nchw_float16_3() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {4, 1, 4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT16, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 2}, |
| }, |
| { |
| .type = OperandType::FLOAT16, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 30, .length = 2}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {5, 1, 2, 2}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {0, 1}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 64, 0, 60, 1 |
| }; |
| const std::vector<hidl_memory> pools = {}; |
| |
| return { |
| .operands = operands, |
| .operations = operations, |
| .inputIndexes = inputIndexes, |
| .outputIndexes = outputIndexes, |
| .operandValues = operandValues, |
| .pools = pools, |
| }; |
| } |
| |
| bool is_ignored_nchw_float16_3(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nchw_float16_dynamic_output_shape_3() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {4, 1, 4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT16, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 2}, |
| }, |
| { |
| .type = OperandType::FLOAT16, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 30, .length = 2}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {0, 0, 0, 0}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {0, 1}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 64, 0, 60, 1 |
| }; |
| const std::vector<hidl_memory> pools = {}; |
| |
| return { |
| .operands = operands, |
| .operations = operations, |
| .inputIndexes = inputIndexes, |
| .outputIndexes = outputIndexes, |
| .operandValues = operandValues, |
| .pools = pools, |
| }; |
| } |
| |
| bool is_ignored_nchw_float16_dynamic_output_shape_3(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nchw_float16_all_inputs_as_internal_3() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {4, 1, 4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT16, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 2}, |
| }, |
| { |
| .type = OperandType::FLOAT16, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 30, .length = 2}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {5, 1, 2, 2}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {4, 1, 4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 33, .length = 2}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 35, .length = 4}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 39, .length = 2}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 41, .length = 4}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ADD, |
| .inputs = {9, 10, 11}, |
| .outputs = {0}, |
| }, |
| { |
| .type = OperationType::ADD, |
| .inputs = {12, 13, 14}, |
| .outputs = {1}, |
| }, |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {9, 12}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 64, 0, 60, 1, 0, 0, 0, 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_nchw_float16_all_inputs_as_internal_3(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling |
| namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling { |
| |
| Model createTestModel_nchw_float16_all_inputs_as_internal_dynamic_output_shape_3() { |
| const std::vector<Operand> operands = { |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {4, 1, 4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_INT32, |
| .dimensions = {5}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 0, .length = 20}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 20, .length = 4}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 24, .length = 4}, |
| }, |
| { |
| .type = OperandType::FLOAT16, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 28, .length = 2}, |
| }, |
| { |
| .type = OperandType::FLOAT16, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 30, .length = 2}, |
| }, |
| { |
| .type = OperandType::BOOL, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 32, .length = 1}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {0, 0, 0, 0}, |
| .numberOfConsumers = 0, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_OUTPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {4, 1, 4, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 33, .length = 2}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 35, .length = 4}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {5, 4}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::MODEL_INPUT, |
| .location = {.poolIndex = 0, .offset = 0, .length = 0}, |
| }, |
| { |
| .type = OperandType::TENSOR_FLOAT16, |
| .dimensions = {1}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 39, .length = 2}, |
| }, |
| { |
| .type = OperandType::INT32, |
| .dimensions = {}, |
| .numberOfConsumers = 1, |
| .scale = 0.0f, |
| .zeroPoint = 0, |
| .lifetime = OperandLifeTime::CONSTANT_COPY, |
| .location = {.poolIndex = 0, .offset = 41, .length = 4}, |
| } |
| }; |
| |
| const std::vector<Operation> operations = { |
| { |
| .type = OperationType::ADD, |
| .inputs = {9, 10, 11}, |
| .outputs = {0}, |
| }, |
| { |
| .type = OperationType::ADD, |
| .inputs = {12, 13, 14}, |
| .outputs = {1}, |
| }, |
| { |
| .type = OperationType::ROI_POOLING, |
| .inputs = {0, 1, 2, 3, 4, 5, 6, 7}, |
| .outputs = {8}, |
| } |
| }; |
| |
| const std::vector<uint32_t> inputIndexes = {9, 12}; |
| const std::vector<uint32_t> outputIndexes = {8}; |
| std::vector<uint8_t> operandValues = { |
| 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 64, 0, 60, 1, 0, 0, 0, 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_nchw_float16_all_inputs_as_internal_dynamic_output_shape_3(int i) { |
| static std::set<int> ignore = {}; |
| return ignore.find(i) != ignore.end(); |
| } |
| |
| } // namespace android::hardware::neuralnetworks::V1_2::generated_tests::roi_pooling |