blob: 665240dd081780193a690b307e5cff265c5a46e6 [file] [log] [blame]
// clang-format off
// Generated file (from: quantize.mod.py). Do not edit
// Create the model
Model createTestModel_quant8() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {300},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {300},
.numberOfConsumers = 0,
.scale = 1.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::QUANTIZE,
.inputs = {0},
.outputs = {1},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {1};
std::vector<uint8_t> operandValues = {};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
bool is_ignored_quant8(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_quant8_2() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {300},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {300},
.numberOfConsumers = 0,
.scale = 1.0f,
.zeroPoint = 1,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::QUANTIZE,
.inputs = {0},
.outputs = {1},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {1};
std::vector<uint8_t> operandValues = {};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
bool is_ignored_quant8_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_quant8_3() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {300},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {300},
.numberOfConsumers = 0,
.scale = 0.01f,
.zeroPoint = 120,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::QUANTIZE,
.inputs = {0},
.outputs = {1},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {1};
std::vector<uint8_t> operandValues = {};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
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_FLOAT32,
.dimensions = {300},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {300},
.numberOfConsumers = 0,
.scale = 10.0f,
.zeroPoint = 120,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::QUANTIZE,
.inputs = {0},
.outputs = {1},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {1};
std::vector<uint8_t> operandValues = {};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
bool is_ignored_quant8_4(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}