blob: 9c05224f72e5113e9477843a26e43656c7046c51 [file] [log] [blame]
// Generated from random_multinomial.mod.py
// DO NOT EDIT
// clang-format off
#include "GeneratedTests.h"
namespace android::hardware::neuralnetworks::V1_2::generated_tests::random_multinomial {
Model createTestModel() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1024},
.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::TENSOR_INT32,
.dimensions = {2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 8},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {1, 128},
.numberOfConsumers = 0,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::MODEL_OUTPUT,
.location = {.poolIndex = 0, .offset = 0, .length = 0},
}
};
const std::vector<Operation> operations = {
{
.type = OperationType::RANDOM_MULTINOMIAL,
.inputs = {0, 1, 2},
.outputs = {3},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {3};
std::vector<uint8_t> operandValues = {
128, 0, 0, 0, 37, 0, 0, 0, 42, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
bool is_ignored(int i) {
static std::set<int> ignore = {0};
return ignore.find(i) != ignore.end();
}
} // namespace android::hardware::neuralnetworks::V1_2::generated_tests::random_multinomial
namespace android::hardware::neuralnetworks::V1_2::generated_tests::random_multinomial {
Model createTestModel_dynamic_output_shape() {
const std::vector<Operand> operands = {
{
.type = OperandType::TENSOR_FLOAT32,
.dimensions = {1, 1024},
.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::TENSOR_INT32,
.dimensions = {2},
.numberOfConsumers = 1,
.scale = 0.0f,
.zeroPoint = 0,
.lifetime = OperandLifeTime::CONSTANT_COPY,
.location = {.poolIndex = 0, .offset = 4, .length = 8},
},
{
.type = OperandType::TENSOR_INT32,
.dimensions = {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::RANDOM_MULTINOMIAL,
.inputs = {0, 1, 2},
.outputs = {3},
}
};
const std::vector<uint32_t> inputIndexes = {0};
const std::vector<uint32_t> outputIndexes = {3};
std::vector<uint8_t> operandValues = {
128, 0, 0, 0, 37, 0, 0, 0, 42, 0, 0, 0
};
const std::vector<hidl_memory> pools = {};
return {
.operands = operands,
.operations = operations,
.inputIndexes = inputIndexes,
.outputIndexes = outputIndexes,
.operandValues = operandValues,
.pools = pools,
};
}
bool is_ignored_dynamic_output_shape(int i) {
static std::set<int> ignore = {0};
return ignore.find(i) != ignore.end();
}
} // namespace android::hardware::neuralnetworks::V1_2::generated_tests::random_multinomial