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