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