// clang-format off // Generated file (from: prelu.mod.py). Do not edit // Create the model Model createTestModel() { const std::vector<Operand> operands = { { .type = OperandType::TENSOR_FLOAT32, .dimensions = {1, 2, 2, 3}, .numberOfConsumers = 1, .scale = 0.0f, .zeroPoint = 0, .lifetime = OperandLifeTime::MODEL_INPUT, .location = {.poolIndex = 0, .offset = 0, .length = 0}, }, { .type = OperandType::TENSOR_FLOAT32, .dimensions = {1, 1, 3}, .numberOfConsumers = 1, .scale = 0.0f, .zeroPoint = 0, .lifetime = OperandLifeTime::CONSTANT_COPY, .location = {.poolIndex = 0, .offset = 0, .length = 12}, }, { .type = OperandType::TENSOR_FLOAT32, .dimensions = {1, 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::PRELU, .inputs = {0, 1}, .outputs = {2}, } }; const std::vector<uint32_t> inputIndexes = {0}; const std::vector<uint32_t> outputIndexes = {2}; std::vector<uint8_t> operandValues = { 0, 0, 0, 0, 0, 0, 128, 63, 0, 0, 0, 64 }; const std::vector<hidl_memory> pools = {}; return { .operands = operands, .operations = operations, .inputIndexes = inputIndexes, .outputIndexes = outputIndexes, .operandValues = operandValues, .pools = pools, }; } inline bool is_ignored(int i) { static std::set<int> ignore = {}; return ignore.find(i) != ignore.end(); } // Create the model Model createTestModel_relaxed() { const std::vector<Operand> operands = { { .type = OperandType::TENSOR_FLOAT32, .dimensions = {1, 2, 2, 3}, .numberOfConsumers = 1, .scale = 0.0f, .zeroPoint = 0, .lifetime = OperandLifeTime::MODEL_INPUT, .location = {.poolIndex = 0, .offset = 0, .length = 0}, }, { .type = OperandType::TENSOR_FLOAT32, .dimensions = {1, 1, 3}, .numberOfConsumers = 1, .scale = 0.0f, .zeroPoint = 0, .lifetime = OperandLifeTime::CONSTANT_COPY, .location = {.poolIndex = 0, .offset = 0, .length = 12}, }, { .type = OperandType::TENSOR_FLOAT32, .dimensions = {1, 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::PRELU, .inputs = {0, 1}, .outputs = {2}, } }; const std::vector<uint32_t> inputIndexes = {0}; const std::vector<uint32_t> outputIndexes = {2}; std::vector<uint8_t> operandValues = { 0, 0, 0, 0, 0, 0, 128, 63, 0, 0, 0, 64 }; const std::vector<hidl_memory> pools = {}; return { .operands = operands, .operations = operations, .inputIndexes = inputIndexes, .outputIndexes = outputIndexes, .operandValues = operandValues, .pools = pools, .relaxComputationFloat32toFloat16 = true, }; } inline bool is_ignored_relaxed(int i) { static std::set<int> ignore = {}; return ignore.find(i) != ignore.end(); } // Create the model Model createTestModel_quant8() { const std::vector<Operand> operands = { { .type = OperandType::TENSOR_QUANT8_ASYMM, .dimensions = {1, 2, 2, 3}, .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, 1, 3}, .numberOfConsumers = 1, .scale = 0.25f, .zeroPoint = 50, .lifetime = OperandLifeTime::CONSTANT_COPY, .location = {.poolIndex = 0, .offset = 0, .length = 3}, }, { .type = OperandType::TENSOR_QUANT8_ASYMM, .dimensions = {1, 2, 2, 3}, .numberOfConsumers = 0, .scale = 0.5f, .zeroPoint = 120, .lifetime = OperandLifeTime::MODEL_OUTPUT, .location = {.poolIndex = 0, .offset = 0, .length = 0}, } }; const std::vector<Operation> operations = { { .type = OperationType::PRELU, .inputs = {0, 1}, .outputs = {2}, } }; const std::vector<uint32_t> inputIndexes = {0}; const std::vector<uint32_t> outputIndexes = {2}; std::vector<uint8_t> operandValues = { 50, 54, 58 }; const std::vector<hidl_memory> pools = {}; return { .operands = operands, .operations = operations, .inputIndexes = inputIndexes, .outputIndexes = outputIndexes, .operandValues = operandValues, .pools = pools, }; } inline bool is_ignored_quant8(int i) { static std::set<int> ignore = {}; return ignore.find(i) != ignore.end(); } // Create the model Model createTestModel_quant8_2() { const std::vector<Operand> operands = { { .type = OperandType::TENSOR_QUANT8_ASYMM, .dimensions = {1, 2, 2, 3}, .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, 1, 3}, .numberOfConsumers = 1, .scale = 0.25f, .zeroPoint = 50, .lifetime = OperandLifeTime::CONSTANT_COPY, .location = {.poolIndex = 0, .offset = 0, .length = 3}, }, { .type = OperandType::TENSOR_QUANT8_ASYMM, .dimensions = {1, 2, 2, 3}, .numberOfConsumers = 0, .scale = 0.25f, .zeroPoint = 120, .lifetime = OperandLifeTime::MODEL_OUTPUT, .location = {.poolIndex = 0, .offset = 0, .length = 0}, } }; const std::vector<Operation> operations = { { .type = OperationType::PRELU, .inputs = {0, 1}, .outputs = {2}, } }; const std::vector<uint32_t> inputIndexes = {0}; const std::vector<uint32_t> outputIndexes = {2}; std::vector<uint8_t> operandValues = { 50, 54, 58 }; const std::vector<hidl_memory> pools = {}; return { .operands = operands, .operations = operations, .inputIndexes = inputIndexes, .outputIndexes = outputIndexes, .operandValues = operandValues, .pools = pools, }; } inline bool is_ignored_quant8_2(int i) { static std::set<int> ignore = {}; return ignore.find(i) != ignore.end(); } // Create the model Model createTestModel_quant8_3() { const std::vector<Operand> operands = { { .type = OperandType::TENSOR_QUANT8_ASYMM, .dimensions = {1, 2, 2, 3}, .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, 1, 3}, .numberOfConsumers = 1, .scale = 0.5f, .zeroPoint = 50, .lifetime = OperandLifeTime::CONSTANT_COPY, .location = {.poolIndex = 0, .offset = 0, .length = 3}, }, { .type = OperandType::TENSOR_QUANT8_ASYMM, .dimensions = {1, 2, 2, 3}, .numberOfConsumers = 0, .scale = 0.125f, .zeroPoint = 120, .lifetime = OperandLifeTime::MODEL_OUTPUT, .location = {.poolIndex = 0, .offset = 0, .length = 0}, } }; const std::vector<Operation> operations = { { .type = OperationType::PRELU, .inputs = {0, 1}, .outputs = {2}, } }; const std::vector<uint32_t> inputIndexes = {0}; const std::vector<uint32_t> outputIndexes = {2}; std::vector<uint8_t> operandValues = { 50, 52, 54 }; const std::vector<hidl_memory> pools = {}; return { .operands = operands, .operations = operations, .inputIndexes = inputIndexes, .outputIndexes = outputIndexes, .operandValues = operandValues, .pools = pools, }; } inline bool is_ignored_quant8_3(int i) { static std::set<int> ignore = {}; return ignore.find(i) != ignore.end(); } // Create the model Model createTestModel_quant8_4() { const std::vector<Operand> operands = { { .type = OperandType::TENSOR_QUANT8_ASYMM, .dimensions = {1, 2, 2, 3}, .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, 1, 3}, .numberOfConsumers = 1, .scale = 0.5f, .zeroPoint = 50, .lifetime = OperandLifeTime::CONSTANT_COPY, .location = {.poolIndex = 0, .offset = 0, .length = 3}, }, { .type = OperandType::TENSOR_QUANT8_ASYMM, .dimensions = {1, 2, 2, 3}, .numberOfConsumers = 0, .scale = 0.1f, .zeroPoint = 120, .lifetime = OperandLifeTime::MODEL_OUTPUT, .location = {.poolIndex = 0, .offset = 0, .length = 0}, } }; const std::vector<Operation> operations = { { .type = OperationType::PRELU, .inputs = {0, 1}, .outputs = {2}, } }; const std::vector<uint32_t> inputIndexes = {0}; const std::vector<uint32_t> outputIndexes = {2}; std::vector<uint8_t> operandValues = { 50, 52, 54 }; const std::vector<hidl_memory> pools = {}; return { .operands = operands, .operations = operations, .inputIndexes = inputIndexes, .outputIndexes = outputIndexes, .operandValues = operandValues, .pools = pools, }; } inline bool is_ignored_quant8_4(int i) { static std::set<int> ignore = {}; return ignore.find(i) != ignore.end(); } // Create the model Model createTestModel_float16() { const std::vector<Operand> operands = { { .type = OperandType::TENSOR_FLOAT16, .dimensions = {1, 2, 2, 3}, .numberOfConsumers = 1, .scale = 0.0f, .zeroPoint = 0, .lifetime = OperandLifeTime::MODEL_INPUT, .location = {.poolIndex = 0, .offset = 0, .length = 0}, }, { .type = OperandType::TENSOR_FLOAT16, .dimensions = {1, 1, 3}, .numberOfConsumers = 1, .scale = 0.0f, .zeroPoint = 0, .lifetime = OperandLifeTime::CONSTANT_COPY, .location = {.poolIndex = 0, .offset = 0, .length = 6}, }, { .type = OperandType::TENSOR_FLOAT16, .dimensions = {1, 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::PRELU, .inputs = {0, 1}, .outputs = {2}, } }; const std::vector<uint32_t> inputIndexes = {0}; const std::vector<uint32_t> outputIndexes = {2}; std::vector<uint8_t> operandValues = { 0, 0, 0, 60, 0, 64 }; const std::vector<hidl_memory> pools = {}; return { .operands = operands, .operations = operations, .inputIndexes = inputIndexes, .outputIndexes = outputIndexes, .operandValues = operandValues, .pools = pools, }; } inline bool is_ignored_float16(int i) { static std::set<int> ignore = {}; return ignore.find(i) != ignore.end(); } // Create the model Model createTestModel_weight_as_input() { const std::vector<Operand> operands = { { .type = OperandType::TENSOR_FLOAT32, .dimensions = {1, 2, 2, 3}, .numberOfConsumers = 1, .scale = 0.0f, .zeroPoint = 0, .lifetime = OperandLifeTime::MODEL_INPUT, .location = {.poolIndex = 0, .offset = 0, .length = 0}, }, { .type = OperandType::TENSOR_FLOAT32, .dimensions = {1, 1, 3}, .numberOfConsumers = 1, .scale = 0.0f, .zeroPoint = 0, .lifetime = OperandLifeTime::MODEL_INPUT, .location = {.poolIndex = 0, .offset = 0, .length = 0}, }, { .type = OperandType::TENSOR_FLOAT32, .dimensions = {1, 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::PRELU, .inputs = {0, 1}, .outputs = {2}, } }; const std::vector<uint32_t> inputIndexes = {0, 1}; const std::vector<uint32_t> outputIndexes = {2}; std::vector<uint8_t> operandValues = {}; const std::vector<hidl_memory> pools = {}; return { .operands = operands, .operations = operations, .inputIndexes = inputIndexes, .outputIndexes = outputIndexes, .operandValues = operandValues, .pools = pools, }; } inline bool is_ignored_weight_as_input(int i) { static std::set<int> ignore = {}; return ignore.find(i) != ignore.end(); } // Create the model Model createTestModel_weight_as_input_relaxed() { const std::vector<Operand> operands = { { .type = OperandType::TENSOR_FLOAT32, .dimensions = {1, 2, 2, 3}, .numberOfConsumers = 1, .scale = 0.0f, .zeroPoint = 0, .lifetime = OperandLifeTime::MODEL_INPUT, .location = {.poolIndex = 0, .offset = 0, .length = 0}, }, { .type = OperandType::TENSOR_FLOAT32, .dimensions = {1, 1, 3}, .numberOfConsumers = 1, .scale = 0.0f, .zeroPoint = 0, .lifetime = OperandLifeTime::MODEL_INPUT, .location = {.poolIndex = 0, .offset = 0, .length = 0}, }, { .type = OperandType::TENSOR_FLOAT32, .dimensions = {1, 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::PRELU, .inputs = {0, 1}, .outputs = {2}, } }; const std::vector<uint32_t> inputIndexes = {0, 1}; const std::vector<uint32_t> outputIndexes = {2}; std::vector<uint8_t> operandValues = {}; const std::vector<hidl_memory> pools = {}; return { .operands = operands, .operations = operations, .inputIndexes = inputIndexes, .outputIndexes = outputIndexes, .operandValues = operandValues, .pools = pools, .relaxComputationFloat32toFloat16 = true, }; } inline bool is_ignored_weight_as_input_relaxed(int i) { static std::set<int> ignore = {}; return ignore.find(i) != ignore.end(); } // Create the model Model createTestModel_weight_as_input_quant8() { const std::vector<Operand> operands = { { .type = OperandType::TENSOR_QUANT8_ASYMM, .dimensions = {1, 2, 2, 3}, .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, 1, 3}, .numberOfConsumers = 1, .scale = 0.25f, .zeroPoint = 50, .lifetime = OperandLifeTime::MODEL_INPUT, .location = {.poolIndex = 0, .offset = 0, .length = 0}, }, { .type = OperandType::TENSOR_QUANT8_ASYMM, .dimensions = {1, 2, 2, 3}, .numberOfConsumers = 0, .scale = 0.5f, .zeroPoint = 120, .lifetime = OperandLifeTime::MODEL_OUTPUT, .location = {.poolIndex = 0, .offset = 0, .length = 0}, } }; const std::vector<Operation> operations = { { .type = OperationType::PRELU, .inputs = {0, 1}, .outputs = {2}, } }; const std::vector<uint32_t> inputIndexes = {0, 1}; const std::vector<uint32_t> outputIndexes = {2}; std::vector<uint8_t> operandValues = {}; const std::vector<hidl_memory> pools = {}; return { .operands = operands, .operations = operations, .inputIndexes = inputIndexes, .outputIndexes = outputIndexes, .operandValues = operandValues, .pools = pools, }; } inline bool is_ignored_weight_as_input_quant8(int i) { static std::set<int> ignore = {}; return ignore.find(i) != ignore.end(); } // Create the model Model createTestModel_weight_as_input_quant8_2() { const std::vector<Operand> operands = { { .type = OperandType::TENSOR_QUANT8_ASYMM, .dimensions = {1, 2, 2, 3}, .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, 1, 3}, .numberOfConsumers = 1, .scale = 0.25f, .zeroPoint = 50, .lifetime = OperandLifeTime::MODEL_INPUT, .location = {.poolIndex = 0, .offset = 0, .length = 0}, }, { .type = OperandType::TENSOR_QUANT8_ASYMM, .dimensions = {1, 2, 2, 3}, .numberOfConsumers = 0, .scale = 0.25f, .zeroPoint = 120, .lifetime = OperandLifeTime::MODEL_OUTPUT, .location = {.poolIndex = 0, .offset = 0, .length = 0}, } }; const std::vector<Operation> operations = { { .type = OperationType::PRELU, .inputs = {0, 1}, .outputs = {2}, } }; const std::vector<uint32_t> inputIndexes = {0, 1}; const std::vector<uint32_t> outputIndexes = {2}; std::vector<uint8_t> operandValues = {}; const std::vector<hidl_memory> pools = {}; return { .operands = operands, .operations = operations, .inputIndexes = inputIndexes, .outputIndexes = outputIndexes, .operandValues = operandValues, .pools = pools, }; } inline bool is_ignored_weight_as_input_quant8_2(int i) { static std::set<int> ignore = {}; return ignore.find(i) != ignore.end(); } // Create the model Model createTestModel_weight_as_input_quant8_3() { const std::vector<Operand> operands = { { .type = OperandType::TENSOR_QUANT8_ASYMM, .dimensions = {1, 2, 2, 3}, .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, 1, 3}, .numberOfConsumers = 1, .scale = 0.5f, .zeroPoint = 50, .lifetime = OperandLifeTime::MODEL_INPUT, .location = {.poolIndex = 0, .offset = 0, .length = 0}, }, { .type = OperandType::TENSOR_QUANT8_ASYMM, .dimensions = {1, 2, 2, 3}, .numberOfConsumers = 0, .scale = 0.125f, .zeroPoint = 120, .lifetime = OperandLifeTime::MODEL_OUTPUT, .location = {.poolIndex = 0, .offset = 0, .length = 0}, } }; const std::vector<Operation> operations = { { .type = OperationType::PRELU, .inputs = {0, 1}, .outputs = {2}, } }; const std::vector<uint32_t> inputIndexes = {0, 1}; const std::vector<uint32_t> outputIndexes = {2}; std::vector<uint8_t> operandValues = {}; const std::vector<hidl_memory> pools = {}; return { .operands = operands, .operations = operations, .inputIndexes = inputIndexes, .outputIndexes = outputIndexes, .operandValues = operandValues, .pools = pools, }; } inline bool is_ignored_weight_as_input_quant8_3(int i) { static std::set<int> ignore = {}; return ignore.find(i) != ignore.end(); } // Create the model Model createTestModel_weight_as_input_quant8_4() { const std::vector<Operand> operands = { { .type = OperandType::TENSOR_QUANT8_ASYMM, .dimensions = {1, 2, 2, 3}, .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, 1, 3}, .numberOfConsumers = 1, .scale = 0.5f, .zeroPoint = 50, .lifetime = OperandLifeTime::MODEL_INPUT, .location = {.poolIndex = 0, .offset = 0, .length = 0}, }, { .type = OperandType::TENSOR_QUANT8_ASYMM, .dimensions = {1, 2, 2, 3}, .numberOfConsumers = 0, .scale = 0.1f, .zeroPoint = 120, .lifetime = OperandLifeTime::MODEL_OUTPUT, .location = {.poolIndex = 0, .offset = 0, .length = 0}, } }; const std::vector<Operation> operations = { { .type = OperationType::PRELU, .inputs = {0, 1}, .outputs = {2}, } }; const std::vector<uint32_t> inputIndexes = {0, 1}; const std::vector<uint32_t> outputIndexes = {2}; std::vector<uint8_t> operandValues = {}; const std::vector<hidl_memory> pools = {}; return { .operands = operands, .operations = operations, .inputIndexes = inputIndexes, .outputIndexes = outputIndexes, .operandValues = operandValues, .pools = pools, }; } inline bool is_ignored_weight_as_input_quant8_4(int i) { static std::set<int> ignore = {}; return ignore.find(i) != ignore.end(); } // Create the model Model createTestModel_weight_as_input_float16() { const std::vector<Operand> operands = { { .type = OperandType::TENSOR_FLOAT16, .dimensions = {1, 2, 2, 3}, .numberOfConsumers = 1, .scale = 0.0f, .zeroPoint = 0, .lifetime = OperandLifeTime::MODEL_INPUT, .location = {.poolIndex = 0, .offset = 0, .length = 0}, }, { .type = OperandType::TENSOR_FLOAT16, .dimensions = {1, 1, 3}, .numberOfConsumers = 1, .scale = 0.0f, .zeroPoint = 0, .lifetime = OperandLifeTime::MODEL_INPUT, .location = {.poolIndex = 0, .offset = 0, .length = 0}, }, { .type = OperandType::TENSOR_FLOAT16, .dimensions = {1, 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::PRELU, .inputs = {0, 1}, .outputs = {2}, } }; const std::vector<uint32_t> inputIndexes = {0, 1}; const std::vector<uint32_t> outputIndexes = {2}; std::vector<uint8_t> operandValues = {}; const std::vector<hidl_memory> pools = {}; return { .operands = operands, .operations = operations, .inputIndexes = inputIndexes, .outputIndexes = outputIndexes, .operandValues = operandValues, .pools = pools, }; } inline bool is_ignored_weight_as_input_float16(int i) { static std::set<int> ignore = {}; return ignore.find(i) != ignore.end(); } // Create the model Model createTestModel_dynamic_output_shape() { const std::vector<Operand> operands = { { .type = OperandType::TENSOR_FLOAT32, .dimensions = {1, 2, 2, 3}, .numberOfConsumers = 1, .scale = 0.0f, .zeroPoint = 0, .lifetime = OperandLifeTime::MODEL_INPUT, .location = {.poolIndex = 0, .offset = 0, .length = 0}, }, { .type = OperandType::TENSOR_FLOAT32, .dimensions = {1, 1, 3}, .numberOfConsumers = 1, .scale = 0.0f, .zeroPoint = 0, .lifetime = OperandLifeTime::CONSTANT_COPY, .location = {.poolIndex = 0, .offset = 0, .length = 12}, }, { .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::PRELU, .inputs = {0, 1}, .outputs = {2}, } }; const std::vector<uint32_t> inputIndexes = {0}; const std::vector<uint32_t> outputIndexes = {2}; std::vector<uint8_t> operandValues = { 0, 0, 0, 0, 0, 0, 128, 63, 0, 0, 0, 64 }; const std::vector<hidl_memory> pools = {}; return { .operands = operands, .operations = operations, .inputIndexes = inputIndexes, .outputIndexes = outputIndexes, .operandValues = operandValues, .pools = pools, }; } inline bool is_ignored_dynamic_output_shape(int i) { static std::set<int> ignore = {}; return ignore.find(i) != ignore.end(); } // Create the model Model createTestModel_dynamic_output_shape_relaxed() { const std::vector<Operand> operands = { { .type = OperandType::TENSOR_FLOAT32, .dimensions = {1, 2, 2, 3}, .numberOfConsumers = 1, .scale = 0.0f, .zeroPoint = 0, .lifetime = OperandLifeTime::MODEL_INPUT, .location = {.poolIndex = 0, .offset = 0, .length = 0}, }, { .type = OperandType::TENSOR_FLOAT32, .dimensions = {1, 1, 3}, .numberOfConsumers = 1, .scale = 0.0f, .zeroPoint = 0, .lifetime = OperandLifeTime::CONSTANT_COPY, .location = {.poolIndex = 0, .offset = 0, .length = 12}, }, { .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::PRELU, .inputs = {0, 1}, .outputs = {2}, } }; const std::vector<uint32_t> inputIndexes = {0}; const std::vector<uint32_t> outputIndexes = {2}; std::vector<uint8_t> operandValues = { 0, 0, 0, 0, 0, 0, 128, 63, 0, 0, 0, 64 }; const std::vector<hidl_memory> pools = {}; return { .operands = operands, .operations = operations, .inputIndexes = inputIndexes, .outputIndexes = outputIndexes, .operandValues = operandValues, .pools = pools, .relaxComputationFloat32toFloat16 = true, }; } inline bool is_ignored_dynamic_output_shape_relaxed(int i) { static std::set<int> ignore = {}; return ignore.find(i) != ignore.end(); } // Create the model Model createTestModel_dynamic_output_shape_quant8() { const std::vector<Operand> operands = { { .type = OperandType::TENSOR_QUANT8_ASYMM, .dimensions = {1, 2, 2, 3}, .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, 1, 3}, .numberOfConsumers = 1, .scale = 0.25f, .zeroPoint = 50, .lifetime = OperandLifeTime::CONSTANT_COPY, .location = {.poolIndex = 0, .offset = 0, .length = 3}, }, { .type = OperandType::TENSOR_QUANT8_ASYMM, .dimensions = {0, 0, 0, 0}, .numberOfConsumers = 0, .scale = 0.5f, .zeroPoint = 120, .lifetime = OperandLifeTime::MODEL_OUTPUT, .location = {.poolIndex = 0, .offset = 0, .length = 0}, } }; const std::vector<Operation> operations = { { .type = OperationType::PRELU, .inputs = {0, 1}, .outputs = {2}, } }; const std::vector<uint32_t> inputIndexes = {0}; const std::vector<uint32_t> outputIndexes = {2}; std::vector<uint8_t> operandValues = { 50, 54, 58 }; const std::vector<hidl_memory> pools = {}; return { .operands = operands, .operations = operations, .inputIndexes = inputIndexes, .outputIndexes = outputIndexes, .operandValues = operandValues, .pools = pools, }; } inline bool is_ignored_dynamic_output_shape_quant8(int i) { static std::set<int> ignore = {}; return ignore.find(i) != ignore.end(); } // Create the model Model createTestModel_dynamic_output_shape_quant8_2() { const std::vector<Operand> operands = { { .type = OperandType::TENSOR_QUANT8_ASYMM, .dimensions = {1, 2, 2, 3}, .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, 1, 3}, .numberOfConsumers = 1, .scale = 0.25f, .zeroPoint = 50, .lifetime = OperandLifeTime::CONSTANT_COPY, .location = {.poolIndex = 0, .offset = 0, .length = 3}, }, { .type = OperandType::TENSOR_QUANT8_ASYMM, .dimensions = {0, 0, 0, 0}, .numberOfConsumers = 0, .scale = 0.25f, .zeroPoint = 120, .lifetime = OperandLifeTime::MODEL_OUTPUT, .location = {.poolIndex = 0, .offset = 0, .length = 0}, } }; const std::vector<Operation> operations = { { .type = OperationType::PRELU, .inputs = {0, 1}, .outputs = {2}, } }; const std::vector<uint32_t> inputIndexes = {0}; const std::vector<uint32_t> outputIndexes = {2}; std::vector<uint8_t> operandValues = { 50, 54, 58 }; const std::vector<hidl_memory> pools = {}; return { .operands = operands, .operations = operations, .inputIndexes = inputIndexes, .outputIndexes = outputIndexes, .operandValues = operandValues, .pools = pools, }; } inline bool is_ignored_dynamic_output_shape_quant8_2(int i) { static std::set<int> ignore = {}; return ignore.find(i) != ignore.end(); } // Create the model Model createTestModel_dynamic_output_shape_quant8_3() { const std::vector<Operand> operands = { { .type = OperandType::TENSOR_QUANT8_ASYMM, .dimensions = {1, 2, 2, 3}, .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, 1, 3}, .numberOfConsumers = 1, .scale = 0.5f, .zeroPoint = 50, .lifetime = OperandLifeTime::CONSTANT_COPY, .location = {.poolIndex = 0, .offset = 0, .length = 3}, }, { .type = OperandType::TENSOR_QUANT8_ASYMM, .dimensions = {0, 0, 0, 0}, .numberOfConsumers = 0, .scale = 0.125f, .zeroPoint = 120, .lifetime = OperandLifeTime::MODEL_OUTPUT, .location = {.poolIndex = 0, .offset = 0, .length = 0}, } }; const std::vector<Operation> operations = { { .type = OperationType::PRELU, .inputs = {0, 1}, .outputs = {2}, } }; const std::vector<uint32_t> inputIndexes = {0}; const std::vector<uint32_t> outputIndexes = {2}; std::vector<uint8_t> operandValues = { 50, 52, 54 }; const std::vector<hidl_memory> pools = {}; return { .operands = operands, .operations = operations, .inputIndexes = inputIndexes, .outputIndexes = outputIndexes, .operandValues = operandValues, .pools = pools, }; } inline bool is_ignored_dynamic_output_shape_quant8_3(int i) { static std::set<int> ignore = {}; return ignore.find(i) != ignore.end(); } // Create the model Model createTestModel_dynamic_output_shape_quant8_4() { const std::vector<Operand> operands = { { .type = OperandType::TENSOR_QUANT8_ASYMM, .dimensions = {1, 2, 2, 3}, .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, 1, 3}, .numberOfConsumers = 1, .scale = 0.5f, .zeroPoint = 50, .lifetime = OperandLifeTime::CONSTANT_COPY, .location = {.poolIndex = 0, .offset = 0, .length = 3}, }, { .type = OperandType::TENSOR_QUANT8_ASYMM, .dimensions = {0, 0, 0, 0}, .numberOfConsumers = 0, .scale = 0.1f, .zeroPoint = 120, .lifetime = OperandLifeTime::MODEL_OUTPUT, .location = {.poolIndex = 0, .offset = 0, .length = 0}, } }; const std::vector<Operation> operations = { { .type = OperationType::PRELU, .inputs = {0, 1}, .outputs = {2}, } }; const std::vector<uint32_t> inputIndexes = {0}; const std::vector<uint32_t> outputIndexes = {2}; std::vector<uint8_t> operandValues = { 50, 52, 54 }; const std::vector<hidl_memory> pools = {}; return { .operands = operands, .operations = operations, .inputIndexes = inputIndexes, .outputIndexes = outputIndexes, .operandValues = operandValues, .pools = pools, }; } inline bool is_ignored_dynamic_output_shape_quant8_4(int i) { static std::set<int> ignore = {}; return ignore.find(i) != ignore.end(); } // Create the model Model createTestModel_dynamic_output_shape_float16() { const std::vector<Operand> operands = { { .type = OperandType::TENSOR_FLOAT16, .dimensions = {1, 2, 2, 3}, .numberOfConsumers = 1, .scale = 0.0f, .zeroPoint = 0, .lifetime = OperandLifeTime::MODEL_INPUT, .location = {.poolIndex = 0, .offset = 0, .length = 0}, }, { .type = OperandType::TENSOR_FLOAT16, .dimensions = {1, 1, 3}, .numberOfConsumers = 1, .scale = 0.0f, .zeroPoint = 0, .lifetime = OperandLifeTime::CONSTANT_COPY, .location = {.poolIndex = 0, .offset = 0, .length = 6}, }, { .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::PRELU, .inputs = {0, 1}, .outputs = {2}, } }; const std::vector<uint32_t> inputIndexes = {0}; const std::vector<uint32_t> outputIndexes = {2}; std::vector<uint8_t> operandValues = { 0, 0, 0, 60, 0, 64 }; const std::vector<hidl_memory> pools = {}; return { .operands = operands, .operations = operations, .inputIndexes = inputIndexes, .outputIndexes = outputIndexes, .operandValues = operandValues, .pools = pools, }; } inline bool is_ignored_dynamic_output_shape_float16(int i) { static std::set<int> ignore = {}; return ignore.find(i) != ignore.end(); } // Create the model Model createTestModel_dynamic_output_shape_weight_as_input() { const std::vector<Operand> operands = { { .type = OperandType::TENSOR_FLOAT32, .dimensions = {1, 2, 2, 3}, .numberOfConsumers = 1, .scale = 0.0f, .zeroPoint = 0, .lifetime = OperandLifeTime::MODEL_INPUT, .location = {.poolIndex = 0, .offset = 0, .length = 0}, }, { .type = OperandType::TENSOR_FLOAT32, .dimensions = {1, 1, 3}, .numberOfConsumers = 1, .scale = 0.0f, .zeroPoint = 0, .lifetime = OperandLifeTime::MODEL_INPUT, .location = {.poolIndex = 0, .offset = 0, .length = 0}, }, { .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::PRELU, .inputs = {0, 1}, .outputs = {2}, } }; const std::vector<uint32_t> inputIndexes = {0, 1}; const std::vector<uint32_t> outputIndexes = {2}; std::vector<uint8_t> operandValues = {}; const std::vector<hidl_memory> pools = {}; return { .operands = operands, .operations = operations, .inputIndexes = inputIndexes, .outputIndexes = outputIndexes, .operandValues = operandValues, .pools = pools, }; } inline bool is_ignored_dynamic_output_shape_weight_as_input(int i) { static std::set<int> ignore = {}; return ignore.find(i) != ignore.end(); } // Create the model Model createTestModel_dynamic_output_shape_weight_as_input_relaxed() { const std::vector<Operand> operands = { { .type = OperandType::TENSOR_FLOAT32, .dimensions = {1, 2, 2, 3}, .numberOfConsumers = 1, .scale = 0.0f, .zeroPoint = 0, .lifetime = OperandLifeTime::MODEL_INPUT, .location = {.poolIndex = 0, .offset = 0, .length = 0}, }, { .type = OperandType::TENSOR_FLOAT32, .dimensions = {1, 1, 3}, .numberOfConsumers = 1, .scale = 0.0f, .zeroPoint = 0, .lifetime = OperandLifeTime::MODEL_INPUT, .location = {.poolIndex = 0, .offset = 0, .length = 0}, }, { .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::PRELU, .inputs = {0, 1}, .outputs = {2}, } }; const std::vector<uint32_t> inputIndexes = {0, 1}; const std::vector<uint32_t> outputIndexes = {2}; std::vector<uint8_t> operandValues = {}; const std::vector<hidl_memory> pools = {}; return { .operands = operands, .operations = operations, .inputIndexes = inputIndexes, .outputIndexes = outputIndexes, .operandValues = operandValues, .pools = pools, .relaxComputationFloat32toFloat16 = true, }; } inline bool is_ignored_dynamic_output_shape_weight_as_input_relaxed(int i) { static std::set<int> ignore = {}; return ignore.find(i) != ignore.end(); } // Create the model Model createTestModel_dynamic_output_shape_weight_as_input_quant8() { const std::vector<Operand> operands = { { .type = OperandType::TENSOR_QUANT8_ASYMM, .dimensions = {1, 2, 2, 3}, .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, 1, 3}, .numberOfConsumers = 1, .scale = 0.25f, .zeroPoint = 50, .lifetime = OperandLifeTime::MODEL_INPUT, .location = {.poolIndex = 0, .offset = 0, .length = 0}, }, { .type = OperandType::TENSOR_QUANT8_ASYMM, .dimensions = {0, 0, 0, 0}, .numberOfConsumers = 0, .scale = 0.5f, .zeroPoint = 120, .lifetime = OperandLifeTime::MODEL_OUTPUT, .location = {.poolIndex = 0, .offset = 0, .length = 0}, } }; const std::vector<Operation> operations = { { .type = OperationType::PRELU, .inputs = {0, 1}, .outputs = {2}, } }; const std::vector<uint32_t> inputIndexes = {0, 1}; const std::vector<uint32_t> outputIndexes = {2}; std::vector<uint8_t> operandValues = {}; const std::vector<hidl_memory> pools = {}; return { .operands = operands, .operations = operations, .inputIndexes = inputIndexes, .outputIndexes = outputIndexes, .operandValues = operandValues, .pools = pools, }; } inline bool is_ignored_dynamic_output_shape_weight_as_input_quant8(int i) { static std::set<int> ignore = {}; return ignore.find(i) != ignore.end(); } // Create the model Model createTestModel_dynamic_output_shape_weight_as_input_quant8_2() { const std::vector<Operand> operands = { { .type = OperandType::TENSOR_QUANT8_ASYMM, .dimensions = {1, 2, 2, 3}, .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, 1, 3}, .numberOfConsumers = 1, .scale = 0.25f, .zeroPoint = 50, .lifetime = OperandLifeTime::MODEL_INPUT, .location = {.poolIndex = 0, .offset = 0, .length = 0}, }, { .type = OperandType::TENSOR_QUANT8_ASYMM, .dimensions = {0, 0, 0, 0}, .numberOfConsumers = 0, .scale = 0.25f, .zeroPoint = 120, .lifetime = OperandLifeTime::MODEL_OUTPUT, .location = {.poolIndex = 0, .offset = 0, .length = 0}, } }; const std::vector<Operation> operations = { { .type = OperationType::PRELU, .inputs = {0, 1}, .outputs = {2}, } }; const std::vector<uint32_t> inputIndexes = {0, 1}; const std::vector<uint32_t> outputIndexes = {2}; std::vector<uint8_t> operandValues = {}; const std::vector<hidl_memory> pools = {}; return { .operands = operands, .operations = operations, .inputIndexes = inputIndexes, .outputIndexes = outputIndexes, .operandValues = operandValues, .pools = pools, }; } inline bool is_ignored_dynamic_output_shape_weight_as_input_quant8_2(int i) { static std::set<int> ignore = {}; return ignore.find(i) != ignore.end(); } // Create the model Model createTestModel_dynamic_output_shape_weight_as_input_quant8_3() { const std::vector<Operand> operands = { { .type = OperandType::TENSOR_QUANT8_ASYMM, .dimensions = {1, 2, 2, 3}, .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, 1, 3}, .numberOfConsumers = 1, .scale = 0.5f, .zeroPoint = 50, .lifetime = OperandLifeTime::MODEL_INPUT, .location = {.poolIndex = 0, .offset = 0, .length = 0}, }, { .type = OperandType::TENSOR_QUANT8_ASYMM, .dimensions = {0, 0, 0, 0}, .numberOfConsumers = 0, .scale = 0.125f, .zeroPoint = 120, .lifetime = OperandLifeTime::MODEL_OUTPUT, .location = {.poolIndex = 0, .offset = 0, .length = 0}, } }; const std::vector<Operation> operations = { { .type = OperationType::PRELU, .inputs = {0, 1}, .outputs = {2}, } }; const std::vector<uint32_t> inputIndexes = {0, 1}; const std::vector<uint32_t> outputIndexes = {2}; std::vector<uint8_t> operandValues = {}; const std::vector<hidl_memory> pools = {}; return { .operands = operands, .operations = operations, .inputIndexes = inputIndexes, .outputIndexes = outputIndexes, .operandValues = operandValues, .pools = pools, }; } inline bool is_ignored_dynamic_output_shape_weight_as_input_quant8_3(int i) { static std::set<int> ignore = {}; return ignore.find(i) != ignore.end(); } // Create the model Model createTestModel_dynamic_output_shape_weight_as_input_quant8_4() { const std::vector<Operand> operands = { { .type = OperandType::TENSOR_QUANT8_ASYMM, .dimensions = {1, 2, 2, 3}, .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, 1, 3}, .numberOfConsumers = 1, .scale = 0.5f, .zeroPoint = 50, .lifetime = OperandLifeTime::MODEL_INPUT, .location = {.poolIndex = 0, .offset = 0, .length = 0}, }, { .type = OperandType::TENSOR_QUANT8_ASYMM, .dimensions = {0, 0, 0, 0}, .numberOfConsumers = 0, .scale = 0.1f, .zeroPoint = 120, .lifetime = OperandLifeTime::MODEL_OUTPUT, .location = {.poolIndex = 0, .offset = 0, .length = 0}, } }; const std::vector<Operation> operations = { { .type = OperationType::PRELU, .inputs = {0, 1}, .outputs = {2}, } }; const std::vector<uint32_t> inputIndexes = {0, 1}; const std::vector<uint32_t> outputIndexes = {2}; std::vector<uint8_t> operandValues = {}; const std::vector<hidl_memory> pools = {}; return { .operands = operands, .operations = operations, .inputIndexes = inputIndexes, .outputIndexes = outputIndexes, .operandValues = operandValues, .pools = pools, }; } inline bool is_ignored_dynamic_output_shape_weight_as_input_quant8_4(int i) { static std::set<int> ignore = {}; return ignore.find(i) != ignore.end(); } // Create the model Model createTestModel_dynamic_output_shape_weight_as_input_float16() { const std::vector<Operand> operands = { { .type = OperandType::TENSOR_FLOAT16, .dimensions = {1, 2, 2, 3}, .numberOfConsumers = 1, .scale = 0.0f, .zeroPoint = 0, .lifetime = OperandLifeTime::MODEL_INPUT, .location = {.poolIndex = 0, .offset = 0, .length = 0}, }, { .type = OperandType::TENSOR_FLOAT16, .dimensions = {1, 1, 3}, .numberOfConsumers = 1, .scale = 0.0f, .zeroPoint = 0, .lifetime = OperandLifeTime::MODEL_INPUT, .location = {.poolIndex = 0, .offset = 0, .length = 0}, }, { .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::PRELU, .inputs = {0, 1}, .outputs = {2}, } }; const std::vector<uint32_t> inputIndexes = {0, 1}; const std::vector<uint32_t> outputIndexes = {2}; std::vector<uint8_t> operandValues = {}; const std::vector<hidl_memory> pools = {}; return { .operands = operands, .operations = operations, .inputIndexes = inputIndexes, .outputIndexes = outputIndexes, .operandValues = operandValues, .pools = pools, }; } inline bool is_ignored_dynamic_output_shape_weight_as_input_float16(int i) { static std::set<int> ignore = {}; return ignore.find(i) != ignore.end(); }