1 // Generated file (from: mul_relaxed.mod.py). Do not edit
CreateModel(Model * model)2 void CreateModel(Model *model) {
3 OperandType type1(Type::INT32, {});
4 OperandType type0(Type::TENSOR_FLOAT32, {1, 2, 2, 1});
5 // Phase 1, operands
6 auto op1 = model->addOperand(&type0);
7 auto op2 = model->addOperand(&type0);
8 auto act = model->addOperand(&type1);
9 auto op3 = model->addOperand(&type0);
10 // Phase 2, operations
11 static int32_t act_init[] = {0};
12 model->setOperandValue(act, act_init, sizeof(int32_t) * 1);
13 model->addOperation(ANEURALNETWORKS_MUL, {op1, op2, act}, {op3});
14 // Phase 3, inputs and outputs
15 model->identifyInputsAndOutputs(
16 {op1, op2},
17 {op3});
18 // Phase 4: set relaxed execution
19 model->relaxComputationFloat32toFloat16(true);
20 assert(model->isValid());
21 }
22
is_ignored(int i)23 bool is_ignored(int i) {
24 static std::set<int> ignore = {};
25 return ignore.find(i) != ignore.end();
26 }
27