blob: 00a736a3834b6d48f7657f07b4f03a5b4a455b7b [file] [log] [blame]
// 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_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();
}