blob: 222a0d6a88303e8c214b6ffb4ba6f072e676193c [file] [log] [blame]
// clang-format off
// Generated file (from: resize_nearest_neighbor.mod.py). Do not edit
// Create the model
Model createTestModel_shape_nhwc() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 1, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
1, 0, 0, 0, 1, 0, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_nhwc(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nhwc_relaxed() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 1, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
1, 0, 0, 0, 1, 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,
};
}
inline bool is_ignored_shape_nhwc_relaxed(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nhwc_quant8() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 128,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 1, 1, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
1, 0, 0, 0, 1, 0, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_nhwc_quant8(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nhwc_float16() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 1, 1, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
1, 0, 0, 0, 1, 0, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_nhwc_float16(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nchw() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 1, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
1, 0, 0, 0, 1, 0, 0, 0, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_nchw(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nchw_relaxed() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 1, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
1, 0, 0, 0, 1, 0, 0, 0, 1
};
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_shape_nchw_relaxed(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nchw_quant8() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 128,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 1, 1, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
1, 0, 0, 0, 1, 0, 0, 0, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_nchw_quant8(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nchw_float16() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 1, 1, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
1, 0, 0, 0, 1, 0, 0, 0, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_nchw_float16(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nhwc() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
1, 0, 0, 0, 1, 0, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_dynamic_output_shape_nhwc(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nhwc_relaxed() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
1, 0, 0, 0, 1, 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,
};
}
inline bool is_ignored_shape_dynamic_output_shape_nhwc_relaxed(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nhwc_quant8() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 128,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
1, 0, 0, 0, 1, 0, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_dynamic_output_shape_nhwc_quant8(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nhwc_float16() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
1, 0, 0, 0, 1, 0, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_dynamic_output_shape_nhwc_float16(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nchw() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
1, 0, 0, 0, 1, 0, 0, 0, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_dynamic_output_shape_nchw(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nchw_relaxed() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
1, 0, 0, 0, 1, 0, 0, 0, 1
};
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_shape_dynamic_output_shape_nchw_relaxed(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nchw_quant8() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 128,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
1, 0, 0, 0, 1, 0, 0, 0, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_dynamic_output_shape_nchw_quant8(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nchw_float16() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
1, 0, 0, 0, 1, 0, 0, 0, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_dynamic_output_shape_nchw_float16(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nhwc() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 1, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
0, 0, 0, 63, 0, 0, 0, 63, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_nhwc(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nhwc_relaxed() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 1, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
0, 0, 0, 63, 0, 0, 0, 63, 0
};
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_scale_nhwc_relaxed(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nhwc_quant8() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 128,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 1, 1, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
0, 0, 0, 63, 0, 0, 0, 63, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_nhwc_quant8(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nhwc_float16() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 2, .length = 2},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 1, 1, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
0, 56, 0, 56, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_nhwc_float16(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nchw() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 1, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
0, 0, 0, 63, 0, 0, 0, 63, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_nchw(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nchw_relaxed() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 1, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
0, 0, 0, 63, 0, 0, 0, 63, 1
};
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_scale_nchw_relaxed(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nchw_quant8() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 128,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 1, 1, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
0, 0, 0, 63, 0, 0, 0, 63, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_nchw_quant8(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nchw_float16() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 2, .length = 2},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 1, 1, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
0, 56, 0, 56, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_nchw_float16(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nhwc() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
0, 0, 0, 63, 0, 0, 0, 63, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_dynamic_output_shape_nhwc(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nhwc_relaxed() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
0, 0, 0, 63, 0, 0, 0, 63, 0
};
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_scale_dynamic_output_shape_nhwc_relaxed(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nhwc_quant8() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 128,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
0, 0, 0, 63, 0, 0, 0, 63, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_dynamic_output_shape_nhwc_quant8(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nhwc_float16() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 2, .length = 2},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
0, 56, 0, 56, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_dynamic_output_shape_nhwc_float16(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nchw() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
0, 0, 0, 63, 0, 0, 0, 63, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_dynamic_output_shape_nchw(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nchw_relaxed() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
0, 0, 0, 63, 0, 0, 0, 63, 1
};
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_scale_dynamic_output_shape_nchw_relaxed(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nchw_quant8() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 128,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
0, 0, 0, 63, 0, 0, 0, 63, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_dynamic_output_shape_nchw_quant8(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nchw_float16() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 2, .length = 2},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
0, 56, 0, 56, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_dynamic_output_shape_nchw_float16(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nhwc_2() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 3, 3, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
3, 0, 0, 0, 3, 0, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_nhwc_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nhwc_relaxed_2() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 3, 3, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
3, 0, 0, 0, 3, 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,
};
}
inline bool is_ignored_shape_nhwc_relaxed_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nhwc_quant8_2() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 3, 3, 1},
.numberOfConsumers = 0,
.scale = 0.25f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
3, 0, 0, 0, 3, 0, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_nhwc_quant8_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nhwc_float16_2() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 3, 3, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
3, 0, 0, 0, 3, 0, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_nhwc_float16_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nchw_2() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 3, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
3, 0, 0, 0, 3, 0, 0, 0, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_nchw_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nchw_relaxed_2() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 3, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
3, 0, 0, 0, 3, 0, 0, 0, 1
};
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_shape_nchw_relaxed_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nchw_quant8_2() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 1, 3, 3},
.numberOfConsumers = 0,
.scale = 0.25f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
3, 0, 0, 0, 3, 0, 0, 0, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_nchw_quant8_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nchw_float16_2() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 1, 3, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
3, 0, 0, 0, 3, 0, 0, 0, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_nchw_float16_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nhwc_2() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
3, 0, 0, 0, 3, 0, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_dynamic_output_shape_nhwc_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nhwc_relaxed_2() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
3, 0, 0, 0, 3, 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,
};
}
inline bool is_ignored_shape_dynamic_output_shape_nhwc_relaxed_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nhwc_quant8_2() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {0, 0, 0, 0},
.numberOfConsumers = 0,
.scale = 0.25f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
3, 0, 0, 0, 3, 0, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_dynamic_output_shape_nhwc_quant8_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nhwc_float16_2() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
3, 0, 0, 0, 3, 0, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_dynamic_output_shape_nhwc_float16_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nchw_2() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
3, 0, 0, 0, 3, 0, 0, 0, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_dynamic_output_shape_nchw_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nchw_relaxed_2() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
3, 0, 0, 0, 3, 0, 0, 0, 1
};
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_shape_dynamic_output_shape_nchw_relaxed_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nchw_quant8_2() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {0, 0, 0, 0},
.numberOfConsumers = 0,
.scale = 0.25f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
3, 0, 0, 0, 3, 0, 0, 0, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_dynamic_output_shape_nchw_quant8_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nchw_float16_2() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
3, 0, 0, 0, 3, 0, 0, 0, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_dynamic_output_shape_nchw_float16_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nhwc_2() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 3, 3, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
0, 0, 192, 63, 0, 0, 192, 63, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_nhwc_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nhwc_relaxed_2() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 3, 3, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
0, 0, 192, 63, 0, 0, 192, 63, 0
};
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_scale_nhwc_relaxed_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nhwc_quant8_2() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 3, 3, 1},
.numberOfConsumers = 0,
.scale = 0.25f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
0, 0, 192, 63, 0, 0, 192, 63, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_nhwc_quant8_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nhwc_float16_2() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 2, .length = 2},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 3, 3, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
0, 62, 0, 62, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_nhwc_float16_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nchw_2() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 3, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
0, 0, 192, 63, 0, 0, 192, 63, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_nchw_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nchw_relaxed_2() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 3, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
0, 0, 192, 63, 0, 0, 192, 63, 1
};
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_scale_nchw_relaxed_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nchw_quant8_2() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 1, 3, 3},
.numberOfConsumers = 0,
.scale = 0.25f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
0, 0, 192, 63, 0, 0, 192, 63, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_nchw_quant8_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nchw_float16_2() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 2, .length = 2},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 1, 3, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
0, 62, 0, 62, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_nchw_float16_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nhwc_2() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
0, 0, 192, 63, 0, 0, 192, 63, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_dynamic_output_shape_nhwc_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nhwc_relaxed_2() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
0, 0, 192, 63, 0, 0, 192, 63, 0
};
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_scale_dynamic_output_shape_nhwc_relaxed_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nhwc_quant8_2() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {0, 0, 0, 0},
.numberOfConsumers = 0,
.scale = 0.25f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
0, 0, 192, 63, 0, 0, 192, 63, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_dynamic_output_shape_nhwc_quant8_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nhwc_float16_2() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 2, .length = 2},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
0, 62, 0, 62, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_dynamic_output_shape_nhwc_float16_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nchw_2() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
0, 0, 192, 63, 0, 0, 192, 63, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_dynamic_output_shape_nchw_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nchw_relaxed_2() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
0, 0, 192, 63, 0, 0, 192, 63, 1
};
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_scale_dynamic_output_shape_nchw_relaxed_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nchw_quant8_2() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {0, 0, 0, 0},
.numberOfConsumers = 0,
.scale = 0.25f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
0, 0, 192, 63, 0, 0, 192, 63, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_dynamic_output_shape_nchw_quant8_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nchw_float16_2() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 2, .length = 2},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
0, 62, 0, 62, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_dynamic_output_shape_nchw_float16_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nhwc_3() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 3, 3, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
2, 0, 0, 0, 2, 0, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_nhwc_3(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nhwc_relaxed_3() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 3, 3, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
2, 0, 0, 0, 2, 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,
};
}
inline bool is_ignored_shape_nhwc_relaxed_3(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nhwc_quant8_3() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 3, 3, 1},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 0,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
2, 0, 0, 0, 2, 0, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_nhwc_quant8_3(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nhwc_float16_3() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 3, 3, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
2, 0, 0, 0, 2, 0, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_nhwc_float16_3(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nchw_3() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 3, 3},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
2, 0, 0, 0, 2, 0, 0, 0, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_nchw_3(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nchw_relaxed_3() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 3, 3},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
2, 0, 0, 0, 2, 0, 0, 0, 1
};
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_shape_nchw_relaxed_3(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nchw_quant8_3() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 1, 3, 3},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 0,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
2, 0, 0, 0, 2, 0, 0, 0, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_nchw_quant8_3(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nchw_float16_3() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 1, 3, 3},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
2, 0, 0, 0, 2, 0, 0, 0, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_nchw_float16_3(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nhwc_3() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 3, 3, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
2, 0, 0, 0, 2, 0, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_dynamic_output_shape_nhwc_3(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nhwc_relaxed_3() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 3, 3, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
2, 0, 0, 0, 2, 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,
};
}
inline bool is_ignored_shape_dynamic_output_shape_nhwc_relaxed_3(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nhwc_quant8_3() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 3, 3, 1},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {0, 0, 0, 0},
.numberOfConsumers = 0,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
2, 0, 0, 0, 2, 0, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_dynamic_output_shape_nhwc_quant8_3(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nhwc_float16_3() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 3, 3, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
2, 0, 0, 0, 2, 0, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_dynamic_output_shape_nhwc_float16_3(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nchw_3() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 3, 3},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
2, 0, 0, 0, 2, 0, 0, 0, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_dynamic_output_shape_nchw_3(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nchw_relaxed_3() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 3, 3},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
2, 0, 0, 0, 2, 0, 0, 0, 1
};
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_shape_dynamic_output_shape_nchw_relaxed_3(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nchw_quant8_3() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 1, 3, 3},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {0, 0, 0, 0},
.numberOfConsumers = 0,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
2, 0, 0, 0, 2, 0, 0, 0, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_dynamic_output_shape_nchw_quant8_3(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nchw_float16_3() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 1, 3, 3},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
2, 0, 0, 0, 2, 0, 0, 0, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_dynamic_output_shape_nchw_float16_3(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nhwc_3() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 3, 3, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
205, 204, 76, 63, 205, 204, 76, 63, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_nhwc_3(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nhwc_relaxed_3() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 3, 3, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
205, 204, 76, 63, 205, 204, 76, 63, 0
};
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_scale_nhwc_relaxed_3(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nhwc_quant8_3() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 3, 3, 1},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 0,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
205, 204, 76, 63, 205, 204, 76, 63, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_nhwc_quant8_3(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nhwc_float16_3() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 3, 3, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 2, .length = 2},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
102, 58, 102, 58, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_nhwc_float16_3(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nchw_3() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 3, 3},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
205, 204, 76, 63, 205, 204, 76, 63, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_nchw_3(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nchw_relaxed_3() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 3, 3},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
205, 204, 76, 63, 205, 204, 76, 63, 1
};
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_scale_nchw_relaxed_3(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nchw_quant8_3() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 1, 3, 3},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 0,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
205, 204, 76, 63, 205, 204, 76, 63, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_nchw_quant8_3(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nchw_float16_3() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 1, 3, 3},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 2, .length = 2},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
102, 58, 102, 58, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_nchw_float16_3(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nhwc_3() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 3, 3, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
205, 204, 76, 63, 205, 204, 76, 63, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_dynamic_output_shape_nhwc_3(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nhwc_relaxed_3() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 3, 3, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
205, 204, 76, 63, 205, 204, 76, 63, 0
};
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_scale_dynamic_output_shape_nhwc_relaxed_3(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nhwc_quant8_3() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 3, 3, 1},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {0, 0, 0, 0},
.numberOfConsumers = 0,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
205, 204, 76, 63, 205, 204, 76, 63, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_dynamic_output_shape_nhwc_quant8_3(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nhwc_float16_3() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 3, 3, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 2, .length = 2},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
102, 58, 102, 58, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_dynamic_output_shape_nhwc_float16_3(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nchw_3() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 3, 3},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
205, 204, 76, 63, 205, 204, 76, 63, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_dynamic_output_shape_nchw_3(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nchw_relaxed_3() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 3, 3},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
205, 204, 76, 63, 205, 204, 76, 63, 1
};
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_scale_dynamic_output_shape_nchw_relaxed_3(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nchw_quant8_3() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 1, 3, 3},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {0, 0, 0, 0},
.numberOfConsumers = 0,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
205, 204, 76, 63, 205, 204, 76, 63, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_dynamic_output_shape_nchw_quant8_3(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nchw_float16_3() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 1, 3, 3},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 2, .length = 2},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
102, 58, 102, 58, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_dynamic_output_shape_nchw_float16_3(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nhwc_4() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2, 5, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
2, 0, 0, 0, 5, 0, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_nhwc_4(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nhwc_relaxed_4() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2, 5, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
2, 0, 0, 0, 5, 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,
};
}
inline bool is_ignored_shape_nhwc_relaxed_4(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nhwc_quant8_4() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 2, 5, 1},
.numberOfConsumers = 0,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
2, 0, 0, 0, 5, 0, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_nhwc_quant8_4(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nhwc_float16_4() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 2, 5, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
2, 0, 0, 0, 5, 0, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_nhwc_float16_4(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nchw_4() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 2, 5},
.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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
2, 0, 0, 0, 5, 0, 0, 0, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_nchw_4(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nchw_relaxed_4() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 2, 5},
.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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
2, 0, 0, 0, 5, 0, 0, 0, 1
};
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_shape_nchw_relaxed_4(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nchw_quant8_4() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 1, 2, 5},
.numberOfConsumers = 0,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
2, 0, 0, 0, 5, 0, 0, 0, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_nchw_quant8_4(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nchw_float16_4() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 1, 2, 5},
.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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
2, 0, 0, 0, 5, 0, 0, 0, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_nchw_float16_4(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nhwc_4() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
2, 0, 0, 0, 5, 0, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_dynamic_output_shape_nhwc_4(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nhwc_relaxed_4() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
2, 0, 0, 0, 5, 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,
};
}
inline bool is_ignored_shape_dynamic_output_shape_nhwc_relaxed_4(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nhwc_quant8_4() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {0, 0, 0, 0},
.numberOfConsumers = 0,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
2, 0, 0, 0, 5, 0, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_dynamic_output_shape_nhwc_quant8_4(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nhwc_float16_4() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
2, 0, 0, 0, 5, 0, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_dynamic_output_shape_nhwc_float16_4(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nchw_4() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
2, 0, 0, 0, 5, 0, 0, 0, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_dynamic_output_shape_nchw_4(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nchw_relaxed_4() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
2, 0, 0, 0, 5, 0, 0, 0, 1
};
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_shape_dynamic_output_shape_nchw_relaxed_4(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nchw_quant8_4() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {0, 0, 0, 0},
.numberOfConsumers = 0,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
2, 0, 0, 0, 5, 0, 0, 0, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_dynamic_output_shape_nchw_quant8_4(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nchw_float16_4() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
2, 0, 0, 0, 5, 0, 0, 0, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_dynamic_output_shape_nchw_float16_4(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nhwc_4() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2, 5, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
205, 204, 140, 63, 102, 102, 38, 64, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_nhwc_4(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nhwc_relaxed_4() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2, 5, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
205, 204, 140, 63, 102, 102, 38, 64, 0
};
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_scale_nhwc_relaxed_4(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nhwc_quant8_4() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 2, 5, 1},
.numberOfConsumers = 0,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
205, 204, 140, 63, 102, 102, 38, 64, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_nhwc_quant8_4(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nhwc_float16_4() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 2, .length = 2},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 2, 5, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
102, 60, 51, 65, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_nhwc_float16_4(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nchw_4() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 2, 5},
.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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
205, 204, 140, 63, 102, 102, 38, 64, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_nchw_4(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nchw_relaxed_4() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 2, 5},
.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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
205, 204, 140, 63, 102, 102, 38, 64, 1
};
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_scale_nchw_relaxed_4(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nchw_quant8_4() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 1, 2, 5},
.numberOfConsumers = 0,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
205, 204, 140, 63, 102, 102, 38, 64, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_nchw_quant8_4(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nchw_float16_4() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 2, .length = 2},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 1, 2, 5},
.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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
102, 60, 51, 65, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_nchw_float16_4(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nhwc_4() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
205, 204, 140, 63, 102, 102, 38, 64, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_dynamic_output_shape_nhwc_4(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nhwc_relaxed_4() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
205, 204, 140, 63, 102, 102, 38, 64, 0
};
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_scale_dynamic_output_shape_nhwc_relaxed_4(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nhwc_quant8_4() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {0, 0, 0, 0},
.numberOfConsumers = 0,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
205, 204, 140, 63, 102, 102, 38, 64, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_dynamic_output_shape_nhwc_quant8_4(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nhwc_float16_4() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 2, .length = 2},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
102, 60, 51, 65, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_dynamic_output_shape_nhwc_float16_4(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nchw_4() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
205, 204, 140, 63, 102, 102, 38, 64, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_dynamic_output_shape_nchw_4(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nchw_relaxed_4() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
205, 204, 140, 63, 102, 102, 38, 64, 1
};
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_scale_dynamic_output_shape_nchw_relaxed_4(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nchw_quant8_4() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {0, 0, 0, 0},
.numberOfConsumers = 0,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
205, 204, 140, 63, 102, 102, 38, 64, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_dynamic_output_shape_nchw_quant8_4(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nchw_float16_4() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 2, .length = 2},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
102, 60, 51, 65, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_dynamic_output_shape_nchw_float16_4(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nhwc_5() {
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::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 3, 3, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
3, 0, 0, 0, 3, 0, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_nhwc_5(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nhwc_relaxed_5() {
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::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 3, 3, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
3, 0, 0, 0, 3, 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,
};
}
inline bool is_ignored_shape_nhwc_relaxed_5(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nhwc_quant8_5() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 4, 4, 1},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 3, 3, 1},
.numberOfConsumers = 0,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
3, 0, 0, 0, 3, 0, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_nhwc_quant8_5(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nhwc_float16_5() {
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::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 3, 3, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
3, 0, 0, 0, 3, 0, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_nhwc_float16_5(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nchw_5() {
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::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 3, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
3, 0, 0, 0, 3, 0, 0, 0, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_nchw_5(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nchw_relaxed_5() {
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::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 3, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
3, 0, 0, 0, 3, 0, 0, 0, 1
};
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_shape_nchw_relaxed_5(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nchw_quant8_5() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 1, 4, 4},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 1, 3, 3},
.numberOfConsumers = 0,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
3, 0, 0, 0, 3, 0, 0, 0, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_nchw_quant8_5(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nchw_float16_5() {
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::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 1, 3, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
3, 0, 0, 0, 3, 0, 0, 0, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_nchw_float16_5(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nhwc_5() {
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::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
3, 0, 0, 0, 3, 0, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_dynamic_output_shape_nhwc_5(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nhwc_relaxed_5() {
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::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
3, 0, 0, 0, 3, 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,
};
}
inline bool is_ignored_shape_dynamic_output_shape_nhwc_relaxed_5(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nhwc_quant8_5() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 4, 4, 1},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {0, 0, 0, 0},
.numberOfConsumers = 0,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
3, 0, 0, 0, 3, 0, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_dynamic_output_shape_nhwc_quant8_5(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nhwc_float16_5() {
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::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
3, 0, 0, 0, 3, 0, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_dynamic_output_shape_nhwc_float16_5(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nchw_5() {
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::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
3, 0, 0, 0, 3, 0, 0, 0, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_dynamic_output_shape_nchw_5(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nchw_relaxed_5() {
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::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
3, 0, 0, 0, 3, 0, 0, 0, 1
};
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_shape_dynamic_output_shape_nchw_relaxed_5(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nchw_quant8_5() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 1, 4, 4},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {0, 0, 0, 0},
.numberOfConsumers = 0,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
3, 0, 0, 0, 3, 0, 0, 0, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_dynamic_output_shape_nchw_quant8_5(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nchw_float16_5() {
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::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
3, 0, 0, 0, 3, 0, 0, 0, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_dynamic_output_shape_nchw_float16_5(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nhwc_5() {
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::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 3, 3, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
102, 102, 102, 63, 102, 102, 102, 63, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_nhwc_5(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nhwc_relaxed_5() {
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::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 3, 3, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
102, 102, 102, 63, 102, 102, 102, 63, 0
};
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_scale_nhwc_relaxed_5(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nhwc_quant8_5() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 4, 4, 1},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 3, 3, 1},
.numberOfConsumers = 0,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
102, 102, 102, 63, 102, 102, 102, 63, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_nhwc_quant8_5(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nhwc_float16_5() {
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::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 2, .length = 2},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 3, 3, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
51, 59, 51, 59, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_nhwc_float16_5(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nchw_5() {
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::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 3, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
102, 102, 102, 63, 102, 102, 102, 63, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_nchw_5(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nchw_relaxed_5() {
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::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 3, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
102, 102, 102, 63, 102, 102, 102, 63, 1
};
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_scale_nchw_relaxed_5(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nchw_quant8_5() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 1, 4, 4},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 1, 3, 3},
.numberOfConsumers = 0,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
102, 102, 102, 63, 102, 102, 102, 63, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_nchw_quant8_5(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nchw_float16_5() {
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::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 2, .length = 2},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 1, 3, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
51, 59, 51, 59, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_nchw_float16_5(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nhwc_5() {
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::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
102, 102, 102, 63, 102, 102, 102, 63, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_dynamic_output_shape_nhwc_5(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nhwc_relaxed_5() {
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::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
102, 102, 102, 63, 102, 102, 102, 63, 0
};
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_scale_dynamic_output_shape_nhwc_relaxed_5(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nhwc_quant8_5() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 4, 4, 1},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {0, 0, 0, 0},
.numberOfConsumers = 0,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
102, 102, 102, 63, 102, 102, 102, 63, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_dynamic_output_shape_nhwc_quant8_5(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nhwc_float16_5() {
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::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 2, .length = 2},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
51, 59, 51, 59, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_dynamic_output_shape_nhwc_float16_5(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nchw_5() {
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::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
102, 102, 102, 63, 102, 102, 102, 63, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_dynamic_output_shape_nchw_5(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nchw_relaxed_5() {
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::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
102, 102, 102, 63, 102, 102, 102, 63, 1
};
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_scale_dynamic_output_shape_nchw_relaxed_5(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nchw_quant8_5() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 1, 4, 4},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {0, 0, 0, 0},
.numberOfConsumers = 0,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
102, 102, 102, 63, 102, 102, 102, 63, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_dynamic_output_shape_nchw_quant8_5(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nchw_float16_5() {
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::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 2, .length = 2},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
51, 59, 51, 59, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_dynamic_output_shape_nchw_float16_5(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nhwc_6() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 5, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
5, 0, 0, 0, 2, 0, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_nhwc_6(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nhwc_relaxed_6() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 5, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
5, 0, 0, 0, 2, 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,
};
}
inline bool is_ignored_shape_nhwc_relaxed_6(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nhwc_quant8_6() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 5, 2, 1},
.numberOfConsumers = 0,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
5, 0, 0, 0, 2, 0, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_nhwc_quant8_6(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nhwc_float16_6() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 5, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
5, 0, 0, 0, 2, 0, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_nhwc_float16_6(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nchw_6() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 5, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
5, 0, 0, 0, 2, 0, 0, 0, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_nchw_6(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nchw_relaxed_6() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 5, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
5, 0, 0, 0, 2, 0, 0, 0, 1
};
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_shape_nchw_relaxed_6(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nchw_quant8_6() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 1, 5, 2},
.numberOfConsumers = 0,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
5, 0, 0, 0, 2, 0, 0, 0, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_nchw_quant8_6(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nchw_float16_6() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 1, 5, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
5, 0, 0, 0, 2, 0, 0, 0, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_nchw_float16_6(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nhwc_6() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
5, 0, 0, 0, 2, 0, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_dynamic_output_shape_nhwc_6(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nhwc_relaxed_6() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
5, 0, 0, 0, 2, 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,
};
}
inline bool is_ignored_shape_dynamic_output_shape_nhwc_relaxed_6(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nhwc_quant8_6() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {0, 0, 0, 0},
.numberOfConsumers = 0,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
5, 0, 0, 0, 2, 0, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_dynamic_output_shape_nhwc_quant8_6(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nhwc_float16_6() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
5, 0, 0, 0, 2, 0, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_dynamic_output_shape_nhwc_float16_6(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nchw_6() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
5, 0, 0, 0, 2, 0, 0, 0, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_dynamic_output_shape_nchw_6(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nchw_relaxed_6() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
5, 0, 0, 0, 2, 0, 0, 0, 1
};
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_shape_dynamic_output_shape_nchw_relaxed_6(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nchw_quant8_6() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {0, 0, 0, 0},
.numberOfConsumers = 0,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
5, 0, 0, 0, 2, 0, 0, 0, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_dynamic_output_shape_nchw_quant8_6(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nchw_float16_6() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
5, 0, 0, 0, 2, 0, 0, 0, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_dynamic_output_shape_nchw_float16_6(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nhwc_6() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 5, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
51, 51, 51, 64, 51, 51, 179, 63, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_nhwc_6(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nhwc_relaxed_6() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 5, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
51, 51, 51, 64, 51, 51, 179, 63, 0
};
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_scale_nhwc_relaxed_6(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nhwc_quant8_6() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 5, 2, 1},
.numberOfConsumers = 0,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
51, 51, 51, 64, 51, 51, 179, 63, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_nhwc_quant8_6(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nhwc_float16_6() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 2, .length = 2},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 5, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
154, 65, 154, 61, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_nhwc_float16_6(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nchw_6() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 5, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
51, 51, 51, 64, 51, 51, 179, 63, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_nchw_6(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nchw_relaxed_6() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 5, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
51, 51, 51, 64, 51, 51, 179, 63, 1
};
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_scale_nchw_relaxed_6(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nchw_quant8_6() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 1, 5, 2},
.numberOfConsumers = 0,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
51, 51, 51, 64, 51, 51, 179, 63, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_nchw_quant8_6(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nchw_float16_6() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 2, .length = 2},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 1, 5, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
154, 65, 154, 61, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_nchw_float16_6(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nhwc_6() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
51, 51, 51, 64, 51, 51, 179, 63, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_dynamic_output_shape_nhwc_6(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nhwc_relaxed_6() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
51, 51, 51, 64, 51, 51, 179, 63, 0
};
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_scale_dynamic_output_shape_nhwc_relaxed_6(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nhwc_quant8_6() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {0, 0, 0, 0},
.numberOfConsumers = 0,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
51, 51, 51, 64, 51, 51, 179, 63, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_dynamic_output_shape_nhwc_quant8_6(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nhwc_float16_6() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 2, .length = 2},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
154, 65, 154, 61, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_dynamic_output_shape_nhwc_float16_6(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nchw_6() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
51, 51, 51, 64, 51, 51, 179, 63, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_dynamic_output_shape_nchw_6(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nchw_relaxed_6() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
51, 51, 51, 64, 51, 51, 179, 63, 1
};
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_scale_dynamic_output_shape_nchw_relaxed_6(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nchw_quant8_6() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {0, 0, 0, 0},
.numberOfConsumers = 0,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
51, 51, 51, 64, 51, 51, 179, 63, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_dynamic_output_shape_nchw_quant8_6(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nchw_float16_6() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 2, .length = 2},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
154, 65, 154, 61, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_dynamic_output_shape_nchw_float16_6(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nhwc_7() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 4, 4, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
4, 0, 0, 0, 4, 0, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_nhwc_7(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nhwc_relaxed_7() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 4, 4, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
4, 0, 0, 0, 4, 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,
};
}
inline bool is_ignored_shape_nhwc_relaxed_7(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nhwc_quant8_7() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 4, 4, 1},
.numberOfConsumers = 0,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
4, 0, 0, 0, 4, 0, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_nhwc_quant8_7(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nhwc_float16_7() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 4, 4, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
4, 0, 0, 0, 4, 0, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_nhwc_float16_7(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nchw_7() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 4, 4},
.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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
4, 0, 0, 0, 4, 0, 0, 0, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_nchw_7(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nchw_relaxed_7() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 4, 4},
.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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
4, 0, 0, 0, 4, 0, 0, 0, 1
};
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_shape_nchw_relaxed_7(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nchw_quant8_7() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 1, 4, 4},
.numberOfConsumers = 0,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
4, 0, 0, 0, 4, 0, 0, 0, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_nchw_quant8_7(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nchw_float16_7() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 1, 4, 4},
.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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
4, 0, 0, 0, 4, 0, 0, 0, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_nchw_float16_7(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nhwc_7() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
4, 0, 0, 0, 4, 0, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_dynamic_output_shape_nhwc_7(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nhwc_relaxed_7() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
4, 0, 0, 0, 4, 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,
};
}
inline bool is_ignored_shape_dynamic_output_shape_nhwc_relaxed_7(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nhwc_quant8_7() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {0, 0, 0, 0},
.numberOfConsumers = 0,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
4, 0, 0, 0, 4, 0, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_dynamic_output_shape_nhwc_quant8_7(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nhwc_float16_7() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
4, 0, 0, 0, 4, 0, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_dynamic_output_shape_nhwc_float16_7(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nchw_7() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
4, 0, 0, 0, 4, 0, 0, 0, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_dynamic_output_shape_nchw_7(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nchw_relaxed_7() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
4, 0, 0, 0, 4, 0, 0, 0, 1
};
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_shape_dynamic_output_shape_nchw_relaxed_7(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nchw_quant8_7() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {0, 0, 0, 0},
.numberOfConsumers = 0,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
4, 0, 0, 0, 4, 0, 0, 0, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_dynamic_output_shape_nchw_quant8_7(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nchw_float16_7() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
4, 0, 0, 0, 4, 0, 0, 0, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_dynamic_output_shape_nchw_float16_7(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nhwc_7() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 4, 4, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
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,
};
}
inline bool is_ignored_scale_nhwc_7(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nhwc_relaxed_7() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 4, 4, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
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,
};
}
inline bool is_ignored_scale_nhwc_relaxed_7(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nhwc_quant8_7() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 4, 4, 1},
.numberOfConsumers = 0,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
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,
};
}
inline bool is_ignored_scale_nhwc_quant8_7(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nhwc_float16_7() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 2, .length = 2},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 4, 4, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
0, 64, 0, 64, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_nhwc_float16_7(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nchw_7() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 4, 4},
.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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
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,
};
}
inline bool is_ignored_scale_nchw_7(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nchw_relaxed_7() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 4, 4},
.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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
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,
};
}
inline bool is_ignored_scale_nchw_relaxed_7(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nchw_quant8_7() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 1, 4, 4},
.numberOfConsumers = 0,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
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,
};
}
inline bool is_ignored_scale_nchw_quant8_7(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nchw_float16_7() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 2, .length = 2},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 1, 4, 4},
.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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
0, 64, 0, 64, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_nchw_float16_7(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nhwc_7() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
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,
};
}
inline bool is_ignored_scale_dynamic_output_shape_nhwc_7(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nhwc_relaxed_7() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
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,
};
}
inline bool is_ignored_scale_dynamic_output_shape_nhwc_relaxed_7(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nhwc_quant8_7() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {0, 0, 0, 0},
.numberOfConsumers = 0,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
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,
};
}
inline bool is_ignored_scale_dynamic_output_shape_nhwc_quant8_7(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nhwc_float16_7() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 2, .length = 2},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
0, 64, 0, 64, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_dynamic_output_shape_nhwc_float16_7(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nchw_7() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
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,
};
}
inline bool is_ignored_scale_dynamic_output_shape_nchw_7(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nchw_relaxed_7() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
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,
};
}
inline bool is_ignored_scale_dynamic_output_shape_nchw_relaxed_7(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nchw_quant8_7() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {0, 0, 0, 0},
.numberOfConsumers = 0,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
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,
};
}
inline bool is_ignored_scale_dynamic_output_shape_nchw_quant8_7(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nchw_float16_7() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 2, .length = 2},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
0, 64, 0, 64, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_dynamic_output_shape_nchw_float16_7(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nhwc_8() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {2, 2, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {2, 3, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
3, 0, 0, 0, 3, 0, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_nhwc_8(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nhwc_relaxed_8() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {2, 2, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {2, 3, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
3, 0, 0, 0, 3, 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,
};
}
inline bool is_ignored_shape_nhwc_relaxed_8(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nhwc_quant8_8() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {2, 2, 2, 2},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {2, 3, 3, 2},
.numberOfConsumers = 0,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
3, 0, 0, 0, 3, 0, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_nhwc_quant8_8(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nhwc_float16_8() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {2, 2, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {2, 3, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
3, 0, 0, 0, 3, 0, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_nhwc_float16_8(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nchw_8() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {2, 2, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {2, 2, 3, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
3, 0, 0, 0, 3, 0, 0, 0, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_nchw_8(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nchw_relaxed_8() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {2, 2, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {2, 2, 3, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
3, 0, 0, 0, 3, 0, 0, 0, 1
};
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_shape_nchw_relaxed_8(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nchw_quant8_8() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {2, 2, 2, 2},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {2, 2, 3, 3},
.numberOfConsumers = 0,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
3, 0, 0, 0, 3, 0, 0, 0, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_nchw_quant8_8(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_nchw_float16_8() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {2, 2, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {2, 2, 3, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
3, 0, 0, 0, 3, 0, 0, 0, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_nchw_float16_8(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nhwc_8() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {2, 2, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
3, 0, 0, 0, 3, 0, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_dynamic_output_shape_nhwc_8(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nhwc_relaxed_8() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {2, 2, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
3, 0, 0, 0, 3, 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,
};
}
inline bool is_ignored_shape_dynamic_output_shape_nhwc_relaxed_8(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nhwc_quant8_8() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {2, 2, 2, 2},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {0, 0, 0, 0},
.numberOfConsumers = 0,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
3, 0, 0, 0, 3, 0, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_dynamic_output_shape_nhwc_quant8_8(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nhwc_float16_8() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {2, 2, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
3, 0, 0, 0, 3, 0, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_dynamic_output_shape_nhwc_float16_8(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nchw_8() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {2, 2, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
3, 0, 0, 0, 3, 0, 0, 0, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_dynamic_output_shape_nchw_8(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nchw_relaxed_8() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {2, 2, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
3, 0, 0, 0, 3, 0, 0, 0, 1
};
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_shape_dynamic_output_shape_nchw_relaxed_8(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nchw_quant8_8() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {2, 2, 2, 2},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {0, 0, 0, 0},
.numberOfConsumers = 0,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
3, 0, 0, 0, 3, 0, 0, 0, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_dynamic_output_shape_nchw_quant8_8(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_shape_dynamic_output_shape_nchw_float16_8() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {2, 2, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
3, 0, 0, 0, 3, 0, 0, 0, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_shape_dynamic_output_shape_nchw_float16_8(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nhwc_8() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {2, 2, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {2, 3, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
205, 204, 204, 63, 102, 102, 230, 63, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_nhwc_8(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nhwc_relaxed_8() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {2, 2, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {2, 3, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
205, 204, 204, 63, 102, 102, 230, 63, 0
};
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_scale_nhwc_relaxed_8(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nhwc_quant8_8() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {2, 2, 2, 2},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {2, 3, 3, 2},
.numberOfConsumers = 0,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
205, 204, 204, 63, 102, 102, 230, 63, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_nhwc_quant8_8(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nhwc_float16_8() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {2, 2, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 2, .length = 2},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {2, 3, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
102, 62, 51, 63, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_nhwc_float16_8(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nchw_8() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {2, 2, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {2, 2, 3, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
205, 204, 204, 63, 102, 102, 230, 63, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_nchw_8(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nchw_relaxed_8() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {2, 2, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {2, 2, 3, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
205, 204, 204, 63, 102, 102, 230, 63, 1
};
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_scale_nchw_relaxed_8(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nchw_quant8_8() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {2, 2, 2, 2},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {2, 2, 3, 3},
.numberOfConsumers = 0,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
205, 204, 204, 63, 102, 102, 230, 63, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_nchw_quant8_8(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_nchw_float16_8() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {2, 2, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 2, .length = 2},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {2, 2, 3, 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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
102, 62, 51, 63, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_nchw_float16_8(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nhwc_8() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {2, 2, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
205, 204, 204, 63, 102, 102, 230, 63, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_dynamic_output_shape_nhwc_8(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nhwc_relaxed_8() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {2, 2, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
205, 204, 204, 63, 102, 102, 230, 63, 0
};
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_scale_dynamic_output_shape_nhwc_relaxed_8(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nhwc_quant8_8() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {2, 2, 2, 2},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {0, 0, 0, 0},
.numberOfConsumers = 0,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
205, 204, 204, 63, 102, 102, 230, 63, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_dynamic_output_shape_nhwc_quant8_8(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nhwc_float16_8() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {2, 2, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 2, .length = 2},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
102, 62, 51, 63, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_dynamic_output_shape_nhwc_float16_8(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nchw_8() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {2, 2, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
205, 204, 204, 63, 102, 102, 230, 63, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_dynamic_output_shape_nchw_8(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nchw_relaxed_8() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {2, 2, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
205, 204, 204, 63, 102, 102, 230, 63, 1
};
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_scale_dynamic_output_shape_nchw_relaxed_8(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nchw_quant8_8() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {2, 2, 2, 2},
.numberOfConsumers = 1,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {0, 0, 0, 0},
.numberOfConsumers = 0,
.scale = 0.25f,
.zeroPoint = 100,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
205, 204, 204, 63, 102, 102, 230, 63, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_dynamic_output_shape_nchw_quant8_8(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_scale_dynamic_output_shape_nchw_float16_8() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {2, 2, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 2, .length = 2},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .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::RESIZE_NEAREST_NEIGHBOR,
.inputs = {0, 1, 2, 3},
.outputs = {4},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {4};
std::vector<uint8_t> operandValues = {
102, 62, 51, 63, 1
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_scale_dynamic_output_shape_nchw_float16_8(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_zero_sized_nhwc() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 8},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 8},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 32},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 40, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 44, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 48, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 52, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 56, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 60, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 64, .length = 4},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {0, 4},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 1, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 68, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 72, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 76, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 80, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 84, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 88, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 2,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 92, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {0, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 93, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 97, .length = 4},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {0, 3, 3, 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::BOX_WITH_NMS_LIMIT,
.inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8},
.outputs = {9, 10, 11, 12},
},
{
.type = OperationType::ROI_ALIGN,
.inputs = {13, 10, 12, 14, 15, 16, 17, 18, 19, 20},
.outputs = {21},
},
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {21, 22, 23, 20},
.outputs = {24},
}
};
const std::vector<uint32_t> inputIndexes = {13};
const std::vector<uint32_t> outputIndexes = {9, 11, 24};
std::vector<uint8_t> operandValues = {
102, 102, 102, 63, 205, 204, 204, 61, 0, 0, 128, 63, 0, 0, 128, 63, 0, 0, 32, 65, 0, 0, 32, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 65, 0, 0, 32, 65, 0, 0, 0, 0, 154, 153, 153, 62, 255, 255, 255, 255, 0, 0, 0, 0, 205, 204, 204, 62, 0, 0, 128, 63, 154, 153, 153, 62, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 64, 4, 0, 0, 0, 4, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_zero_sized_nhwc(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_zero_sized_nhwc_relaxed() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 8},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 8},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 32},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 40, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 44, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 48, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 52, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 56, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 60, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 64, .length = 4},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {0, 4},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 1, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 68, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 72, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 76, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 80, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 84, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 88, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 2,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 92, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {0, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 93, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 97, .length = 4},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {0, 3, 3, 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::BOX_WITH_NMS_LIMIT,
.inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8},
.outputs = {9, 10, 11, 12},
},
{
.type = OperationType::ROI_ALIGN,
.inputs = {13, 10, 12, 14, 15, 16, 17, 18, 19, 20},
.outputs = {21},
},
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {21, 22, 23, 20},
.outputs = {24},
}
};
const std::vector<uint32_t> inputIndexes = {13};
const std::vector<uint32_t> outputIndexes = {9, 11, 24};
std::vector<uint8_t> operandValues = {
102, 102, 102, 63, 205, 204, 204, 61, 0, 0, 128, 63, 0, 0, 128, 63, 0, 0, 32, 65, 0, 0, 32, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 65, 0, 0, 32, 65, 0, 0, 0, 0, 154, 153, 153, 62, 255, 255, 255, 255, 0, 0, 0, 0, 205, 204, 204, 62, 0, 0, 128, 63, 154, 153, 153, 62, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 64, 4, 0, 0, 0, 4, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0
};
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_zero_sized_nhwc_relaxed(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_zero_sized_nhwc_quant8() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 2},
.numberOfConsumers = 1,
.scale = 0.1f,
.zeroPoint = 128,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 2},
},
{
.type = OperandType::TENSOR_QUANT16_ASYMM,
.dimensions = {1, 8},
.numberOfConsumers = 1,
.scale = 0.125f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 2, .length = 16},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 18, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 22, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 26, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 30, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 34, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 38, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 42, .length = 4},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.1f,
.zeroPoint = 128,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_QUANT16_ASYMM,
.dimensions = {0, 4},
.numberOfConsumers = 1,
.scale = 0.125f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 1, 1, 1},
.numberOfConsumers = 1,
.scale = 0.1f,
.zeroPoint = 128,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 46, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 50, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 54, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 58, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 62, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 66, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 2,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 70, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {0, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.1f,
.zeroPoint = 128,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 71, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 75, .length = 4},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {0, 3, 3, 1},
.numberOfConsumers = 0,
.scale = 0.1f,
.zeroPoint = 128,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::BOX_WITH_NMS_LIMIT,
.inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8},
.outputs = {9, 10, 11, 12},
},
{
.type = OperationType::ROI_ALIGN,
.inputs = {13, 10, 12, 14, 15, 16, 17, 18, 19, 20},
.outputs = {21},
},
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {21, 22, 23, 20},
.outputs = {24},
}
};
const std::vector<uint32_t> inputIndexes = {13};
const std::vector<uint32_t> outputIndexes = {9, 11, 24};
std::vector<uint8_t> operandValues = {
137, 129, 8, 0, 8, 0, 80, 0, 80, 0, 0, 0, 0, 0, 80, 0, 80, 0, 0, 0, 0, 0, 154, 153, 153, 62, 255, 255, 255, 255, 0, 0, 0, 0, 205, 204, 204, 62, 0, 0, 128, 63, 154, 153, 153, 62, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 64, 4, 0, 0, 0, 4, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_zero_sized_nhwc_quant8(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_zero_sized_nhwc_float16() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 8},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 16},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {1},
.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::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 26, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 30, .length = 4},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 34, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 36, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 38, .length = 2},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {0, 4},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 1, 1, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 40, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 44, .length = 4},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 48, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 50, .length = 2},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 52, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 56, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 2,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 60, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {0, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 61, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 65, .length = 4},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {0, 3, 3, 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::BOX_WITH_NMS_LIMIT,
.inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8},
.outputs = {9, 10, 11, 12},
},
{
.type = OperationType::ROI_ALIGN,
.inputs = {13, 10, 12, 14, 15, 16, 17, 18, 19, 20},
.outputs = {21},
},
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {21, 22, 23, 20},
.outputs = {24},
}
};
const std::vector<uint32_t> inputIndexes = {13};
const std::vector<uint32_t> outputIndexes = {9, 11, 24};
std::vector<uint8_t> operandValues = {
51, 59, 102, 46, 0, 60, 0, 60, 0, 73, 0, 73, 0, 0, 0, 0, 0, 73, 0, 73, 0, 0, 0, 0, 205, 52, 255, 255, 255, 255, 0, 0, 0, 0, 102, 54, 0, 60, 205, 52, 2, 0, 0, 0, 2, 0, 0, 0, 0, 64, 0, 64, 4, 0, 0, 0, 4, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_zero_sized_nhwc_float16(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_zero_sized_nchw() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 8},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 8},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 32},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 40, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 44, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 48, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 52, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 56, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 60, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 64, .length = 4},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {0, 4},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 1, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 68, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 72, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 76, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 80, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 84, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 88, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 2,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 92, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {0, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 93, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 97, .length = 4},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {0, 1, 3, 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::BOX_WITH_NMS_LIMIT,
.inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8},
.outputs = {9, 10, 11, 12},
},
{
.type = OperationType::ROI_ALIGN,
.inputs = {13, 10, 12, 14, 15, 16, 17, 18, 19, 20},
.outputs = {21},
},
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {21, 22, 23, 20},
.outputs = {24},
}
};
const std::vector<uint32_t> inputIndexes = {13};
const std::vector<uint32_t> outputIndexes = {9, 11, 24};
std::vector<uint8_t> operandValues = {
102, 102, 102, 63, 205, 204, 204, 61, 0, 0, 128, 63, 0, 0, 128, 63, 0, 0, 32, 65, 0, 0, 32, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 65, 0, 0, 32, 65, 0, 0, 0, 0, 154, 153, 153, 62, 255, 255, 255, 255, 0, 0, 0, 0, 205, 204, 204, 62, 0, 0, 128, 63, 154, 153, 153, 62, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 64, 4, 0, 0, 0, 4, 0, 0, 0, 1, 3, 0, 0, 0, 3, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_zero_sized_nchw(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_zero_sized_nchw_relaxed() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 8},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 8},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 32},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 40, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 44, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 48, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 52, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 56, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 60, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 64, .length = 4},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {0, 4},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 1, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 68, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 72, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 76, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 80, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 84, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 88, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 2,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 92, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {0, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 93, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 97, .length = 4},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {0, 1, 3, 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::BOX_WITH_NMS_LIMIT,
.inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8},
.outputs = {9, 10, 11, 12},
},
{
.type = OperationType::ROI_ALIGN,
.inputs = {13, 10, 12, 14, 15, 16, 17, 18, 19, 20},
.outputs = {21},
},
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {21, 22, 23, 20},
.outputs = {24},
}
};
const std::vector<uint32_t> inputIndexes = {13};
const std::vector<uint32_t> outputIndexes = {9, 11, 24};
std::vector<uint8_t> operandValues = {
102, 102, 102, 63, 205, 204, 204, 61, 0, 0, 128, 63, 0, 0, 128, 63, 0, 0, 32, 65, 0, 0, 32, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 65, 0, 0, 32, 65, 0, 0, 0, 0, 154, 153, 153, 62, 255, 255, 255, 255, 0, 0, 0, 0, 205, 204, 204, 62, 0, 0, 128, 63, 154, 153, 153, 62, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 64, 4, 0, 0, 0, 4, 0, 0, 0, 1, 3, 0, 0, 0, 3, 0, 0, 0
};
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_zero_sized_nchw_relaxed(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_zero_sized_nchw_quant8() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 2},
.numberOfConsumers = 1,
.scale = 0.1f,
.zeroPoint = 128,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 2},
},
{
.type = OperandType::TENSOR_QUANT16_ASYMM,
.dimensions = {1, 8},
.numberOfConsumers = 1,
.scale = 0.125f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 2, .length = 16},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 18, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 22, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 26, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 30, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 34, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 38, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 42, .length = 4},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.1f,
.zeroPoint = 128,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_QUANT16_ASYMM,
.dimensions = {0, 4},
.numberOfConsumers = 1,
.scale = 0.125f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 1, 1, 1},
.numberOfConsumers = 1,
.scale = 0.1f,
.zeroPoint = 128,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 46, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 50, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 54, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 58, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 62, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 66, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 2,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 70, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {0, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.1f,
.zeroPoint = 128,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 71, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 75, .length = 4},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {0, 1, 3, 3},
.numberOfConsumers = 0,
.scale = 0.1f,
.zeroPoint = 128,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::BOX_WITH_NMS_LIMIT,
.inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8},
.outputs = {9, 10, 11, 12},
},
{
.type = OperationType::ROI_ALIGN,
.inputs = {13, 10, 12, 14, 15, 16, 17, 18, 19, 20},
.outputs = {21},
},
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {21, 22, 23, 20},
.outputs = {24},
}
};
const std::vector<uint32_t> inputIndexes = {13};
const std::vector<uint32_t> outputIndexes = {9, 11, 24};
std::vector<uint8_t> operandValues = {
137, 129, 8, 0, 8, 0, 80, 0, 80, 0, 0, 0, 0, 0, 80, 0, 80, 0, 0, 0, 0, 0, 154, 153, 153, 62, 255, 255, 255, 255, 0, 0, 0, 0, 205, 204, 204, 62, 0, 0, 128, 63, 154, 153, 153, 62, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 64, 4, 0, 0, 0, 4, 0, 0, 0, 1, 3, 0, 0, 0, 3, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_zero_sized_nchw_quant8(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_zero_sized_nchw_float16() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 8},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 16},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {1},
.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::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 26, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 30, .length = 4},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 34, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 36, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 38, .length = 2},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {0, 4},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 1, 1, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 40, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 44, .length = 4},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 48, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 50, .length = 2},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 52, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 56, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 2,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 60, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {0, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 61, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 65, .length = 4},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {0, 1, 3, 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::BOX_WITH_NMS_LIMIT,
.inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8},
.outputs = {9, 10, 11, 12},
},
{
.type = OperationType::ROI_ALIGN,
.inputs = {13, 10, 12, 14, 15, 16, 17, 18, 19, 20},
.outputs = {21},
},
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {21, 22, 23, 20},
.outputs = {24},
}
};
const std::vector<uint32_t> inputIndexes = {13};
const std::vector<uint32_t> outputIndexes = {9, 11, 24};
std::vector<uint8_t> operandValues = {
51, 59, 102, 46, 0, 60, 0, 60, 0, 73, 0, 73, 0, 0, 0, 0, 0, 73, 0, 73, 0, 0, 0, 0, 205, 52, 255, 255, 255, 255, 0, 0, 0, 0, 102, 54, 0, 60, 205, 52, 2, 0, 0, 0, 2, 0, 0, 0, 0, 64, 0, 64, 4, 0, 0, 0, 4, 0, 0, 0, 1, 3, 0, 0, 0, 3, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_zero_sized_nchw_float16(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_zero_sized_dynamic_output_shape_nhwc() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 8},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 8},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 32},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 40, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 44, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 48, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 52, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 56, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 60, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 64, .length = 4},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {0, 4},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 1, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 68, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 72, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 76, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 80, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 84, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 88, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 2,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 92, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {0, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 93, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 97, .length = 4},
},
{
.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::BOX_WITH_NMS_LIMIT,
.inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8},
.outputs = {9, 10, 11, 12},
},
{
.type = OperationType::ROI_ALIGN,
.inputs = {13, 10, 12, 14, 15, 16, 17, 18, 19, 20},
.outputs = {21},
},
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {21, 22, 23, 20},
.outputs = {24},
}
};
const std::vector<uint32_t> inputIndexes = {13};
const std::vector<uint32_t> outputIndexes = {9, 11, 24};
std::vector<uint8_t> operandValues = {
102, 102, 102, 63, 205, 204, 204, 61, 0, 0, 128, 63, 0, 0, 128, 63, 0, 0, 32, 65, 0, 0, 32, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 65, 0, 0, 32, 65, 0, 0, 0, 0, 154, 153, 153, 62, 255, 255, 255, 255, 0, 0, 0, 0, 205, 204, 204, 62, 0, 0, 128, 63, 154, 153, 153, 62, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 64, 4, 0, 0, 0, 4, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_zero_sized_dynamic_output_shape_nhwc(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_zero_sized_dynamic_output_shape_nhwc_relaxed() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 8},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 8},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 32},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 40, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 44, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 48, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 52, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 56, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 60, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 64, .length = 4},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {0, 4},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 1, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 68, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 72, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 76, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 80, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 84, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 88, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 2,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 92, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {0, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 93, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 97, .length = 4},
},
{
.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::BOX_WITH_NMS_LIMIT,
.inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8},
.outputs = {9, 10, 11, 12},
},
{
.type = OperationType::ROI_ALIGN,
.inputs = {13, 10, 12, 14, 15, 16, 17, 18, 19, 20},
.outputs = {21},
},
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {21, 22, 23, 20},
.outputs = {24},
}
};
const std::vector<uint32_t> inputIndexes = {13};
const std::vector<uint32_t> outputIndexes = {9, 11, 24};
std::vector<uint8_t> operandValues = {
102, 102, 102, 63, 205, 204, 204, 61, 0, 0, 128, 63, 0, 0, 128, 63, 0, 0, 32, 65, 0, 0, 32, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 65, 0, 0, 32, 65, 0, 0, 0, 0, 154, 153, 153, 62, 255, 255, 255, 255, 0, 0, 0, 0, 205, 204, 204, 62, 0, 0, 128, 63, 154, 153, 153, 62, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 64, 4, 0, 0, 0, 4, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0
};
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_zero_sized_dynamic_output_shape_nhwc_relaxed(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_zero_sized_dynamic_output_shape_nhwc_quant8() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 2},
.numberOfConsumers = 1,
.scale = 0.1f,
.zeroPoint = 128,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 2},
},
{
.type = OperandType::TENSOR_QUANT16_ASYMM,
.dimensions = {1, 8},
.numberOfConsumers = 1,
.scale = 0.125f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 2, .length = 16},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 18, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 22, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 26, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 30, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 34, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 38, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 42, .length = 4},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.1f,
.zeroPoint = 128,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_QUANT16_ASYMM,
.dimensions = {0, 4},
.numberOfConsumers = 1,
.scale = 0.125f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 1, 1, 1},
.numberOfConsumers = 1,
.scale = 0.1f,
.zeroPoint = 128,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 46, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 50, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 54, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 58, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 62, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 66, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 2,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 70, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {0, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.1f,
.zeroPoint = 128,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 71, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 75, .length = 4},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {0, 0, 0, 0},
.numberOfConsumers = 0,
.scale = 0.1f,
.zeroPoint = 128,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::BOX_WITH_NMS_LIMIT,
.inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8},
.outputs = {9, 10, 11, 12},
},
{
.type = OperationType::ROI_ALIGN,
.inputs = {13, 10, 12, 14, 15, 16, 17, 18, 19, 20},
.outputs = {21},
},
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {21, 22, 23, 20},
.outputs = {24},
}
};
const std::vector<uint32_t> inputIndexes = {13};
const std::vector<uint32_t> outputIndexes = {9, 11, 24};
std::vector<uint8_t> operandValues = {
137, 129, 8, 0, 8, 0, 80, 0, 80, 0, 0, 0, 0, 0, 80, 0, 80, 0, 0, 0, 0, 0, 154, 153, 153, 62, 255, 255, 255, 255, 0, 0, 0, 0, 205, 204, 204, 62, 0, 0, 128, 63, 154, 153, 153, 62, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 64, 4, 0, 0, 0, 4, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_zero_sized_dynamic_output_shape_nhwc_quant8(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_zero_sized_dynamic_output_shape_nhwc_float16() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 8},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 16},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {1},
.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::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 26, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 30, .length = 4},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 34, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 36, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 38, .length = 2},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {0, 4},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 1, 1, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 40, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 44, .length = 4},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 48, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 50, .length = 2},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 52, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 56, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 2,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 60, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {0, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 61, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 65, .length = 4},
},
{
.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::BOX_WITH_NMS_LIMIT,
.inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8},
.outputs = {9, 10, 11, 12},
},
{
.type = OperationType::ROI_ALIGN,
.inputs = {13, 10, 12, 14, 15, 16, 17, 18, 19, 20},
.outputs = {21},
},
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {21, 22, 23, 20},
.outputs = {24},
}
};
const std::vector<uint32_t> inputIndexes = {13};
const std::vector<uint32_t> outputIndexes = {9, 11, 24};
std::vector<uint8_t> operandValues = {
51, 59, 102, 46, 0, 60, 0, 60, 0, 73, 0, 73, 0, 0, 0, 0, 0, 73, 0, 73, 0, 0, 0, 0, 205, 52, 255, 255, 255, 255, 0, 0, 0, 0, 102, 54, 0, 60, 205, 52, 2, 0, 0, 0, 2, 0, 0, 0, 0, 64, 0, 64, 4, 0, 0, 0, 4, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_zero_sized_dynamic_output_shape_nhwc_float16(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_zero_sized_dynamic_output_shape_nchw() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 8},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 8},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 32},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 40, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 44, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 48, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 52, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 56, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 60, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 64, .length = 4},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {0, 4},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 1, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 68, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 72, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 76, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 80, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 84, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 88, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 2,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 92, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {0, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 93, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 97, .length = 4},
},
{
.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::BOX_WITH_NMS_LIMIT,
.inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8},
.outputs = {9, 10, 11, 12},
},
{
.type = OperationType::ROI_ALIGN,
.inputs = {13, 10, 12, 14, 15, 16, 17, 18, 19, 20},
.outputs = {21},
},
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {21, 22, 23, 20},
.outputs = {24},
}
};
const std::vector<uint32_t> inputIndexes = {13};
const std::vector<uint32_t> outputIndexes = {9, 11, 24};
std::vector<uint8_t> operandValues = {
102, 102, 102, 63, 205, 204, 204, 61, 0, 0, 128, 63, 0, 0, 128, 63, 0, 0, 32, 65, 0, 0, 32, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 65, 0, 0, 32, 65, 0, 0, 0, 0, 154, 153, 153, 62, 255, 255, 255, 255, 0, 0, 0, 0, 205, 204, 204, 62, 0, 0, 128, 63, 154, 153, 153, 62, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 64, 4, 0, 0, 0, 4, 0, 0, 0, 1, 3, 0, 0, 0, 3, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_zero_sized_dynamic_output_shape_nchw(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_zero_sized_dynamic_output_shape_nchw_relaxed() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 8},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 8},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 32},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 40, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 44, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 48, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 52, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 56, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 60, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 64, .length = 4},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {0, 4},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 1, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 68, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 72, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 76, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 80, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 84, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 88, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 2,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 92, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {0, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 93, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 97, .length = 4},
},
{
.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::BOX_WITH_NMS_LIMIT,
.inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8},
.outputs = {9, 10, 11, 12},
},
{
.type = OperationType::ROI_ALIGN,
.inputs = {13, 10, 12, 14, 15, 16, 17, 18, 19, 20},
.outputs = {21},
},
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {21, 22, 23, 20},
.outputs = {24},
}
};
const std::vector<uint32_t> inputIndexes = {13};
const std::vector<uint32_t> outputIndexes = {9, 11, 24};
std::vector<uint8_t> operandValues = {
102, 102, 102, 63, 205, 204, 204, 61, 0, 0, 128, 63, 0, 0, 128, 63, 0, 0, 32, 65, 0, 0, 32, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 65, 0, 0, 32, 65, 0, 0, 0, 0, 154, 153, 153, 62, 255, 255, 255, 255, 0, 0, 0, 0, 205, 204, 204, 62, 0, 0, 128, 63, 154, 153, 153, 62, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 64, 4, 0, 0, 0, 4, 0, 0, 0, 1, 3, 0, 0, 0, 3, 0, 0, 0
};
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_zero_sized_dynamic_output_shape_nchw_relaxed(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_zero_sized_dynamic_output_shape_nchw_quant8() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 2},
.numberOfConsumers = 1,
.scale = 0.1f,
.zeroPoint = 128,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 2},
},
{
.type = OperandType::TENSOR_QUANT16_ASYMM,
.dimensions = {1, 8},
.numberOfConsumers = 1,
.scale = 0.125f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 2, .length = 16},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 18, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 22, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 26, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 30, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 34, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 38, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 42, .length = 4},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.1f,
.zeroPoint = 128,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_QUANT16_ASYMM,
.dimensions = {0, 4},
.numberOfConsumers = 1,
.scale = 0.125f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 1, 1, 1},
.numberOfConsumers = 1,
.scale = 0.1f,
.zeroPoint = 128,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 46, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 50, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 54, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 58, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 62, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 66, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 2,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 70, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {0, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.1f,
.zeroPoint = 128,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 71, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 75, .length = 4},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {0, 0, 0, 0},
.numberOfConsumers = 0,
.scale = 0.1f,
.zeroPoint = 128,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::BOX_WITH_NMS_LIMIT,
.inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8},
.outputs = {9, 10, 11, 12},
},
{
.type = OperationType::ROI_ALIGN,
.inputs = {13, 10, 12, 14, 15, 16, 17, 18, 19, 20},
.outputs = {21},
},
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {21, 22, 23, 20},
.outputs = {24},
}
};
const std::vector<uint32_t> inputIndexes = {13};
const std::vector<uint32_t> outputIndexes = {9, 11, 24};
std::vector<uint8_t> operandValues = {
137, 129, 8, 0, 8, 0, 80, 0, 80, 0, 0, 0, 0, 0, 80, 0, 80, 0, 0, 0, 0, 0, 154, 153, 153, 62, 255, 255, 255, 255, 0, 0, 0, 0, 205, 204, 204, 62, 0, 0, 128, 63, 154, 153, 153, 62, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 64, 4, 0, 0, 0, 4, 0, 0, 0, 1, 3, 0, 0, 0, 3, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_zero_sized_dynamic_output_shape_nchw_quant8(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_zero_sized_dynamic_output_shape_nchw_float16() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 8},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 16},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {1},
.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::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 26, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 30, .length = 4},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 34, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 36, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 38, .length = 2},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {0, 4},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 1, 1, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 40, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 44, .length = 4},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 48, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 50, .length = 2},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 52, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 56, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 2,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 60, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {0, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 61, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 65, .length = 4},
},
{
.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::BOX_WITH_NMS_LIMIT,
.inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8},
.outputs = {9, 10, 11, 12},
},
{
.type = OperationType::ROI_ALIGN,
.inputs = {13, 10, 12, 14, 15, 16, 17, 18, 19, 20},
.outputs = {21},
},
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {21, 22, 23, 20},
.outputs = {24},
}
};
const std::vector<uint32_t> inputIndexes = {13};
const std::vector<uint32_t> outputIndexes = {9, 11, 24};
std::vector<uint8_t> operandValues = {
51, 59, 102, 46, 0, 60, 0, 60, 0, 73, 0, 73, 0, 0, 0, 0, 0, 73, 0, 73, 0, 0, 0, 0, 205, 52, 255, 255, 255, 255, 0, 0, 0, 0, 102, 54, 0, 60, 205, 52, 2, 0, 0, 0, 2, 0, 0, 0, 0, 64, 0, 64, 4, 0, 0, 0, 4, 0, 0, 0, 1, 3, 0, 0, 0, 3, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_zero_sized_dynamic_output_shape_nchw_float16(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_zero_sized_nhwc_2() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 8},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 8},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 32},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 40, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 44, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 48, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 52, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 56, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 60, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 64, .length = 4},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {0, 4},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 1, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 68, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 72, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 76, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 80, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 84, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 88, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 2,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 92, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {0, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 93, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 97, .length = 4},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {0, 3, 3, 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::BOX_WITH_NMS_LIMIT,
.inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8},
.outputs = {9, 10, 11, 12},
},
{
.type = OperationType::ROI_ALIGN,
.inputs = {13, 10, 12, 14, 15, 16, 17, 18, 19, 20},
.outputs = {21},
},
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {21, 22, 23, 20},
.outputs = {24},
}
};
const std::vector<uint32_t> inputIndexes = {13};
const std::vector<uint32_t> outputIndexes = {9, 11, 24};
std::vector<uint8_t> operandValues = {
102, 102, 102, 63, 205, 204, 204, 61, 0, 0, 128, 63, 0, 0, 128, 63, 0, 0, 32, 65, 0, 0, 32, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 65, 0, 0, 32, 65, 0, 0, 0, 0, 154, 153, 153, 62, 255, 255, 255, 255, 0, 0, 0, 0, 205, 204, 204, 62, 0, 0, 128, 63, 154, 153, 153, 62, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 64, 4, 0, 0, 0, 4, 0, 0, 0, 0, 205, 204, 204, 63, 205, 204, 204, 63
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_zero_sized_nhwc_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_zero_sized_nhwc_relaxed_2() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 8},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 8},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 32},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 40, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 44, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 48, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 52, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 56, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 60, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 64, .length = 4},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {0, 4},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 1, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 68, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 72, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 76, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 80, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 84, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 88, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 2,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 92, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {0, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 93, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 97, .length = 4},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {0, 3, 3, 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::BOX_WITH_NMS_LIMIT,
.inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8},
.outputs = {9, 10, 11, 12},
},
{
.type = OperationType::ROI_ALIGN,
.inputs = {13, 10, 12, 14, 15, 16, 17, 18, 19, 20},
.outputs = {21},
},
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {21, 22, 23, 20},
.outputs = {24},
}
};
const std::vector<uint32_t> inputIndexes = {13};
const std::vector<uint32_t> outputIndexes = {9, 11, 24};
std::vector<uint8_t> operandValues = {
102, 102, 102, 63, 205, 204, 204, 61, 0, 0, 128, 63, 0, 0, 128, 63, 0, 0, 32, 65, 0, 0, 32, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 65, 0, 0, 32, 65, 0, 0, 0, 0, 154, 153, 153, 62, 255, 255, 255, 255, 0, 0, 0, 0, 205, 204, 204, 62, 0, 0, 128, 63, 154, 153, 153, 62, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 64, 4, 0, 0, 0, 4, 0, 0, 0, 0, 205, 204, 204, 63, 205, 204, 204, 63
};
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_zero_sized_nhwc_relaxed_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_zero_sized_nhwc_quant8_2() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 2},
.numberOfConsumers = 1,
.scale = 0.1f,
.zeroPoint = 128,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 2},
},
{
.type = OperandType::TENSOR_QUANT16_ASYMM,
.dimensions = {1, 8},
.numberOfConsumers = 1,
.scale = 0.125f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 2, .length = 16},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 18, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 22, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 26, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 30, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 34, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 38, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 42, .length = 4},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.1f,
.zeroPoint = 128,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_QUANT16_ASYMM,
.dimensions = {0, 4},
.numberOfConsumers = 1,
.scale = 0.125f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 1, 1, 1},
.numberOfConsumers = 1,
.scale = 0.1f,
.zeroPoint = 128,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 46, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 50, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 54, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 58, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 62, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 66, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 2,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 70, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {0, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.1f,
.zeroPoint = 128,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 71, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 75, .length = 4},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {0, 3, 3, 1},
.numberOfConsumers = 0,
.scale = 0.1f,
.zeroPoint = 128,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::BOX_WITH_NMS_LIMIT,
.inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8},
.outputs = {9, 10, 11, 12},
},
{
.type = OperationType::ROI_ALIGN,
.inputs = {13, 10, 12, 14, 15, 16, 17, 18, 19, 20},
.outputs = {21},
},
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {21, 22, 23, 20},
.outputs = {24},
}
};
const std::vector<uint32_t> inputIndexes = {13};
const std::vector<uint32_t> outputIndexes = {9, 11, 24};
std::vector<uint8_t> operandValues = {
137, 129, 8, 0, 8, 0, 80, 0, 80, 0, 0, 0, 0, 0, 80, 0, 80, 0, 0, 0, 0, 0, 154, 153, 153, 62, 255, 255, 255, 255, 0, 0, 0, 0, 205, 204, 204, 62, 0, 0, 128, 63, 154, 153, 153, 62, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 64, 4, 0, 0, 0, 4, 0, 0, 0, 0, 205, 204, 204, 63, 205, 204, 204, 63
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_zero_sized_nhwc_quant8_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_zero_sized_nhwc_float16_2() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 8},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 16},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {1},
.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::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 26, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 30, .length = 4},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 34, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 36, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 38, .length = 2},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {0, 4},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 1, 1, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 40, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 44, .length = 4},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 48, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 50, .length = 2},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 52, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 56, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 2,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 60, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {0, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 61, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 63, .length = 2},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {0, 3, 3, 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::BOX_WITH_NMS_LIMIT,
.inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8},
.outputs = {9, 10, 11, 12},
},
{
.type = OperationType::ROI_ALIGN,
.inputs = {13, 10, 12, 14, 15, 16, 17, 18, 19, 20},
.outputs = {21},
},
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {21, 22, 23, 20},
.outputs = {24},
}
};
const std::vector<uint32_t> inputIndexes = {13};
const std::vector<uint32_t> outputIndexes = {9, 11, 24};
std::vector<uint8_t> operandValues = {
51, 59, 102, 46, 0, 60, 0, 60, 0, 73, 0, 73, 0, 0, 0, 0, 0, 73, 0, 73, 0, 0, 0, 0, 205, 52, 255, 255, 255, 255, 0, 0, 0, 0, 102, 54, 0, 60, 205, 52, 2, 0, 0, 0, 2, 0, 0, 0, 0, 64, 0, 64, 4, 0, 0, 0, 4, 0, 0, 0, 0, 102, 62, 102, 62
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_zero_sized_nhwc_float16_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_zero_sized_nchw_2() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 8},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 8},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 32},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 40, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 44, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 48, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 52, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 56, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 60, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 64, .length = 4},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {0, 4},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 1, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 68, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 72, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 76, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 80, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 84, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 88, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 2,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 92, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {0, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 93, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 97, .length = 4},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {0, 1, 3, 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::BOX_WITH_NMS_LIMIT,
.inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8},
.outputs = {9, 10, 11, 12},
},
{
.type = OperationType::ROI_ALIGN,
.inputs = {13, 10, 12, 14, 15, 16, 17, 18, 19, 20},
.outputs = {21},
},
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {21, 22, 23, 20},
.outputs = {24},
}
};
const std::vector<uint32_t> inputIndexes = {13};
const std::vector<uint32_t> outputIndexes = {9, 11, 24};
std::vector<uint8_t> operandValues = {
102, 102, 102, 63, 205, 204, 204, 61, 0, 0, 128, 63, 0, 0, 128, 63, 0, 0, 32, 65, 0, 0, 32, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 65, 0, 0, 32, 65, 0, 0, 0, 0, 154, 153, 153, 62, 255, 255, 255, 255, 0, 0, 0, 0, 205, 204, 204, 62, 0, 0, 128, 63, 154, 153, 153, 62, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 64, 4, 0, 0, 0, 4, 0, 0, 0, 1, 205, 204, 204, 63, 205, 204, 204, 63
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_zero_sized_nchw_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_zero_sized_nchw_relaxed_2() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 8},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 8},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 32},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 40, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 44, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 48, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 52, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 56, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 60, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 64, .length = 4},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {0, 4},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 1, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 68, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 72, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 76, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 80, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 84, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 88, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 2,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 92, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {0, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 93, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 97, .length = 4},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {0, 1, 3, 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::BOX_WITH_NMS_LIMIT,
.inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8},
.outputs = {9, 10, 11, 12},
},
{
.type = OperationType::ROI_ALIGN,
.inputs = {13, 10, 12, 14, 15, 16, 17, 18, 19, 20},
.outputs = {21},
},
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {21, 22, 23, 20},
.outputs = {24},
}
};
const std::vector<uint32_t> inputIndexes = {13};
const std::vector<uint32_t> outputIndexes = {9, 11, 24};
std::vector<uint8_t> operandValues = {
102, 102, 102, 63, 205, 204, 204, 61, 0, 0, 128, 63, 0, 0, 128, 63, 0, 0, 32, 65, 0, 0, 32, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 65, 0, 0, 32, 65, 0, 0, 0, 0, 154, 153, 153, 62, 255, 255, 255, 255, 0, 0, 0, 0, 205, 204, 204, 62, 0, 0, 128, 63, 154, 153, 153, 62, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 64, 4, 0, 0, 0, 4, 0, 0, 0, 1, 205, 204, 204, 63, 205, 204, 204, 63
};
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_zero_sized_nchw_relaxed_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_zero_sized_nchw_quant8_2() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 2},
.numberOfConsumers = 1,
.scale = 0.1f,
.zeroPoint = 128,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 2},
},
{
.type = OperandType::TENSOR_QUANT16_ASYMM,
.dimensions = {1, 8},
.numberOfConsumers = 1,
.scale = 0.125f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 2, .length = 16},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 18, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 22, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 26, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 30, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 34, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 38, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 42, .length = 4},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.1f,
.zeroPoint = 128,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_QUANT16_ASYMM,
.dimensions = {0, 4},
.numberOfConsumers = 1,
.scale = 0.125f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 1, 1, 1},
.numberOfConsumers = 1,
.scale = 0.1f,
.zeroPoint = 128,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 46, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 50, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 54, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 58, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 62, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 66, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 2,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 70, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {0, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.1f,
.zeroPoint = 128,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 71, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 75, .length = 4},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {0, 1, 3, 3},
.numberOfConsumers = 0,
.scale = 0.1f,
.zeroPoint = 128,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::BOX_WITH_NMS_LIMIT,
.inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8},
.outputs = {9, 10, 11, 12},
},
{
.type = OperationType::ROI_ALIGN,
.inputs = {13, 10, 12, 14, 15, 16, 17, 18, 19, 20},
.outputs = {21},
},
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {21, 22, 23, 20},
.outputs = {24},
}
};
const std::vector<uint32_t> inputIndexes = {13};
const std::vector<uint32_t> outputIndexes = {9, 11, 24};
std::vector<uint8_t> operandValues = {
137, 129, 8, 0, 8, 0, 80, 0, 80, 0, 0, 0, 0, 0, 80, 0, 80, 0, 0, 0, 0, 0, 154, 153, 153, 62, 255, 255, 255, 255, 0, 0, 0, 0, 205, 204, 204, 62, 0, 0, 128, 63, 154, 153, 153, 62, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 64, 4, 0, 0, 0, 4, 0, 0, 0, 1, 205, 204, 204, 63, 205, 204, 204, 63
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_zero_sized_nchw_quant8_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_zero_sized_nchw_float16_2() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 8},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 16},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {1},
.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::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 26, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 30, .length = 4},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 34, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 36, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 38, .length = 2},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {0, 4},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 1, 1, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 40, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 44, .length = 4},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 48, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 50, .length = 2},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 52, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 56, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 2,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 60, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {0, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 61, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 63, .length = 2},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {0, 1, 3, 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::BOX_WITH_NMS_LIMIT,
.inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8},
.outputs = {9, 10, 11, 12},
},
{
.type = OperationType::ROI_ALIGN,
.inputs = {13, 10, 12, 14, 15, 16, 17, 18, 19, 20},
.outputs = {21},
},
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {21, 22, 23, 20},
.outputs = {24},
}
};
const std::vector<uint32_t> inputIndexes = {13};
const std::vector<uint32_t> outputIndexes = {9, 11, 24};
std::vector<uint8_t> operandValues = {
51, 59, 102, 46, 0, 60, 0, 60, 0, 73, 0, 73, 0, 0, 0, 0, 0, 73, 0, 73, 0, 0, 0, 0, 205, 52, 255, 255, 255, 255, 0, 0, 0, 0, 102, 54, 0, 60, 205, 52, 2, 0, 0, 0, 2, 0, 0, 0, 0, 64, 0, 64, 4, 0, 0, 0, 4, 0, 0, 0, 1, 102, 62, 102, 62
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_zero_sized_nchw_float16_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_zero_sized_dynamic_output_shape_nhwc_2() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 8},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 8},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 32},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 40, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 44, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 48, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 52, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 56, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 60, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 64, .length = 4},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {0, 4},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 1, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 68, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 72, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 76, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 80, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 84, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 88, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 2,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 92, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {0, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 93, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 97, .length = 4},
},
{
.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::BOX_WITH_NMS_LIMIT,
.inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8},
.outputs = {9, 10, 11, 12},
},
{
.type = OperationType::ROI_ALIGN,
.inputs = {13, 10, 12, 14, 15, 16, 17, 18, 19, 20},
.outputs = {21},
},
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {21, 22, 23, 20},
.outputs = {24},
}
};
const std::vector<uint32_t> inputIndexes = {13};
const std::vector<uint32_t> outputIndexes = {9, 11, 24};
std::vector<uint8_t> operandValues = {
102, 102, 102, 63, 205, 204, 204, 61, 0, 0, 128, 63, 0, 0, 128, 63, 0, 0, 32, 65, 0, 0, 32, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 65, 0, 0, 32, 65, 0, 0, 0, 0, 154, 153, 153, 62, 255, 255, 255, 255, 0, 0, 0, 0, 205, 204, 204, 62, 0, 0, 128, 63, 154, 153, 153, 62, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 64, 4, 0, 0, 0, 4, 0, 0, 0, 0, 205, 204, 204, 63, 205, 204, 204, 63
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_zero_sized_dynamic_output_shape_nhwc_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_zero_sized_dynamic_output_shape_nhwc_relaxed_2() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 8},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 8},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 32},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 40, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 44, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 48, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 52, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 56, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 60, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 64, .length = 4},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {0, 4},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 1, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 68, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 72, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 76, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 80, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 84, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 88, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 2,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 92, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {0, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 93, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 97, .length = 4},
},
{
.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::BOX_WITH_NMS_LIMIT,
.inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8},
.outputs = {9, 10, 11, 12},
},
{
.type = OperationType::ROI_ALIGN,
.inputs = {13, 10, 12, 14, 15, 16, 17, 18, 19, 20},
.outputs = {21},
},
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {21, 22, 23, 20},
.outputs = {24},
}
};
const std::vector<uint32_t> inputIndexes = {13};
const std::vector<uint32_t> outputIndexes = {9, 11, 24};
std::vector<uint8_t> operandValues = {
102, 102, 102, 63, 205, 204, 204, 61, 0, 0, 128, 63, 0, 0, 128, 63, 0, 0, 32, 65, 0, 0, 32, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 65, 0, 0, 32, 65, 0, 0, 0, 0, 154, 153, 153, 62, 255, 255, 255, 255, 0, 0, 0, 0, 205, 204, 204, 62, 0, 0, 128, 63, 154, 153, 153, 62, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 64, 4, 0, 0, 0, 4, 0, 0, 0, 0, 205, 204, 204, 63, 205, 204, 204, 63
};
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_zero_sized_dynamic_output_shape_nhwc_relaxed_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_zero_sized_dynamic_output_shape_nhwc_quant8_2() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 2},
.numberOfConsumers = 1,
.scale = 0.1f,
.zeroPoint = 128,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 2},
},
{
.type = OperandType::TENSOR_QUANT16_ASYMM,
.dimensions = {1, 8},
.numberOfConsumers = 1,
.scale = 0.125f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 2, .length = 16},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 18, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 22, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 26, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 30, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 34, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 38, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 42, .length = 4},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.1f,
.zeroPoint = 128,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_QUANT16_ASYMM,
.dimensions = {0, 4},
.numberOfConsumers = 1,
.scale = 0.125f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 1, 1, 1},
.numberOfConsumers = 1,
.scale = 0.1f,
.zeroPoint = 128,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 46, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 50, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 54, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 58, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 62, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 66, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 2,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 70, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {0, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.1f,
.zeroPoint = 128,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 71, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 75, .length = 4},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {0, 0, 0, 0},
.numberOfConsumers = 0,
.scale = 0.1f,
.zeroPoint = 128,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::BOX_WITH_NMS_LIMIT,
.inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8},
.outputs = {9, 10, 11, 12},
},
{
.type = OperationType::ROI_ALIGN,
.inputs = {13, 10, 12, 14, 15, 16, 17, 18, 19, 20},
.outputs = {21},
},
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {21, 22, 23, 20},
.outputs = {24},
}
};
const std::vector<uint32_t> inputIndexes = {13};
const std::vector<uint32_t> outputIndexes = {9, 11, 24};
std::vector<uint8_t> operandValues = {
137, 129, 8, 0, 8, 0, 80, 0, 80, 0, 0, 0, 0, 0, 80, 0, 80, 0, 0, 0, 0, 0, 154, 153, 153, 62, 255, 255, 255, 255, 0, 0, 0, 0, 205, 204, 204, 62, 0, 0, 128, 63, 154, 153, 153, 62, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 64, 4, 0, 0, 0, 4, 0, 0, 0, 0, 205, 204, 204, 63, 205, 204, 204, 63
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_zero_sized_dynamic_output_shape_nhwc_quant8_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_zero_sized_dynamic_output_shape_nhwc_float16_2() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 8},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 16},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {1},
.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::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 26, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 30, .length = 4},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 34, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 36, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 38, .length = 2},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {0, 4},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 1, 1, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 40, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 44, .length = 4},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 48, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 50, .length = 2},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 52, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 56, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 2,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 60, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {0, 2, 2, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 61, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 63, .length = 2},
},
{
.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::BOX_WITH_NMS_LIMIT,
.inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8},
.outputs = {9, 10, 11, 12},
},
{
.type = OperationType::ROI_ALIGN,
.inputs = {13, 10, 12, 14, 15, 16, 17, 18, 19, 20},
.outputs = {21},
},
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {21, 22, 23, 20},
.outputs = {24},
}
};
const std::vector<uint32_t> inputIndexes = {13};
const std::vector<uint32_t> outputIndexes = {9, 11, 24};
std::vector<uint8_t> operandValues = {
51, 59, 102, 46, 0, 60, 0, 60, 0, 73, 0, 73, 0, 0, 0, 0, 0, 73, 0, 73, 0, 0, 0, 0, 205, 52, 255, 255, 255, 255, 0, 0, 0, 0, 102, 54, 0, 60, 205, 52, 2, 0, 0, 0, 2, 0, 0, 0, 0, 64, 0, 64, 4, 0, 0, 0, 4, 0, 0, 0, 0, 102, 62, 102, 62
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_zero_sized_dynamic_output_shape_nhwc_float16_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_zero_sized_dynamic_output_shape_nchw_2() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 8},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 8},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 32},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 40, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 44, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 48, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 52, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 56, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 60, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 64, .length = 4},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {0, 4},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 1, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 68, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 72, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 76, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 80, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 84, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 88, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 2,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 92, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {0, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 93, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 97, .length = 4},
},
{
.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::BOX_WITH_NMS_LIMIT,
.inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8},
.outputs = {9, 10, 11, 12},
},
{
.type = OperationType::ROI_ALIGN,
.inputs = {13, 10, 12, 14, 15, 16, 17, 18, 19, 20},
.outputs = {21},
},
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {21, 22, 23, 20},
.outputs = {24},
}
};
const std::vector<uint32_t> inputIndexes = {13};
const std::vector<uint32_t> outputIndexes = {9, 11, 24};
std::vector<uint8_t> operandValues = {
102, 102, 102, 63, 205, 204, 204, 61, 0, 0, 128, 63, 0, 0, 128, 63, 0, 0, 32, 65, 0, 0, 32, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 65, 0, 0, 32, 65, 0, 0, 0, 0, 154, 153, 153, 62, 255, 255, 255, 255, 0, 0, 0, 0, 205, 204, 204, 62, 0, 0, 128, 63, 154, 153, 153, 62, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 64, 4, 0, 0, 0, 4, 0, 0, 0, 1, 205, 204, 204, 63, 205, 204, 204, 63
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_zero_sized_dynamic_output_shape_nchw_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_zero_sized_dynamic_output_shape_nchw_relaxed_2() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 8},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 8},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 8, .length = 32},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 40, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 44, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 48, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 52, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 56, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 60, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 64, .length = 4},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {0, 4},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1, 1, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 68, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 72, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 76, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 80, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 84, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 88, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 2,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 92, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {0, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 93, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 97, .length = 4},
},
{
.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::BOX_WITH_NMS_LIMIT,
.inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8},
.outputs = {9, 10, 11, 12},
},
{
.type = OperationType::ROI_ALIGN,
.inputs = {13, 10, 12, 14, 15, 16, 17, 18, 19, 20},
.outputs = {21},
},
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {21, 22, 23, 20},
.outputs = {24},
}
};
const std::vector<uint32_t> inputIndexes = {13};
const std::vector<uint32_t> outputIndexes = {9, 11, 24};
std::vector<uint8_t> operandValues = {
102, 102, 102, 63, 205, 204, 204, 61, 0, 0, 128, 63, 0, 0, 128, 63, 0, 0, 32, 65, 0, 0, 32, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 65, 0, 0, 32, 65, 0, 0, 0, 0, 154, 153, 153, 62, 255, 255, 255, 255, 0, 0, 0, 0, 205, 204, 204, 62, 0, 0, 128, 63, 154, 153, 153, 62, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 64, 4, 0, 0, 0, 4, 0, 0, 0, 1, 205, 204, 204, 63, 205, 204, 204, 63
};
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_zero_sized_dynamic_output_shape_nchw_relaxed_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_zero_sized_dynamic_output_shape_nchw_quant8_2() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 2},
.numberOfConsumers = 1,
.scale = 0.1f,
.zeroPoint = 128,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 2},
},
{
.type = OperandType::TENSOR_QUANT16_ASYMM,
.dimensions = {1, 8},
.numberOfConsumers = 1,
.scale = 0.125f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 2, .length = 16},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 18, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 22, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 26, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 30, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 34, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 38, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 42, .length = 4},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.1f,
.zeroPoint = 128,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_QUANT16_ASYMM,
.dimensions = {0, 4},
.numberOfConsumers = 1,
.scale = 0.125f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {1, 1, 1, 1},
.numberOfConsumers = 1,
.scale = 0.1f,
.zeroPoint = 128,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 46, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 50, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 54, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 58, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 62, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 66, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 2,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 70, .length = 1},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {0, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.1f,
.zeroPoint = 128,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 71, .length = 4},
},
{
.type = OperandType::FLOAT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 75, .length = 4},
},
{
.type = OperandType::TENSOR_QUANT8_ASYMM,
.dimensions = {0, 0, 0, 0},
.numberOfConsumers = 0,
.scale = 0.1f,
.zeroPoint = 128,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::BOX_WITH_NMS_LIMIT,
.inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8},
.outputs = {9, 10, 11, 12},
},
{
.type = OperationType::ROI_ALIGN,
.inputs = {13, 10, 12, 14, 15, 16, 17, 18, 19, 20},
.outputs = {21},
},
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {21, 22, 23, 20},
.outputs = {24},
}
};
const std::vector<uint32_t> inputIndexes = {13};
const std::vector<uint32_t> outputIndexes = {9, 11, 24};
std::vector<uint8_t> operandValues = {
137, 129, 8, 0, 8, 0, 80, 0, 80, 0, 0, 0, 0, 0, 80, 0, 80, 0, 0, 0, 0, 0, 154, 153, 153, 62, 255, 255, 255, 255, 0, 0, 0, 0, 205, 204, 204, 62, 0, 0, 128, 63, 154, 153, 153, 62, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 64, 4, 0, 0, 0, 4, 0, 0, 0, 1, 205, 204, 204, 63, 205, 204, 204, 63
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_zero_sized_dynamic_output_shape_nchw_quant8_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}
// Create the model
Model createTestModel_zero_sized_dynamic_output_shape_nchw_float16_2() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 0, .length = 4},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 8},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 16},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {1},
.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::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 26, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 30, .length = 4},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 34, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 36, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 38, .length = 2},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {0, 4},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 0,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {0},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {1, 1, 1, 1},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_INPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 40, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 44, .length = 4},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 48, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 50, .length = 2},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 52, .length = 4},
},
{
.type = OperandType::INT32,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 56, .length = 4},
},
{
.type = OperandType::BOOL,
.dimensions = {},
.numberOfConsumers = 2,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 60, .length = 1},
},
{
.type = OperandType::TENSOR_FLOAT16,
.dimensions = {0, 1, 2, 2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::TEMPORARY_VARIABLE,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 61, .length = 2},
},
{
.type = OperandType::FLOAT16,
.dimensions = {},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 63, .length = 2},
},
{
.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::BOX_WITH_NMS_LIMIT,
.inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8},
.outputs = {9, 10, 11, 12},
},
{
.type = OperationType::ROI_ALIGN,
.inputs = {13, 10, 12, 14, 15, 16, 17, 18, 19, 20},
.outputs = {21},
},
{
.type = OperationType::RESIZE_NEAREST_NEIGHBOR,
.inputs = {21, 22, 23, 20},
.outputs = {24},
}
};
const std::vector<uint32_t> inputIndexes = {13};
const std::vector<uint32_t> outputIndexes = {9, 11, 24};
std::vector<uint8_t> operandValues = {
51, 59, 102, 46, 0, 60, 0, 60, 0, 73, 0, 73, 0, 0, 0, 0, 0, 73, 0, 73, 0, 0, 0, 0, 205, 52, 255, 255, 255, 255, 0, 0, 0, 0, 102, 54, 0, 60, 205, 52, 2, 0, 0, 0, 2, 0, 0, 0, 0, 64, 0, 64, 4, 0, 0, 0, 4, 0, 0, 0, 1, 102, 62, 102, 62
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
inline bool is_ignored_zero_sized_dynamic_output_shape_nchw_float16_2(int i) {
static std::set<int> ignore = {};
return ignore.find(i) != ignore.end();
}