1 // Generated file (from: fully_connected_float.mod.py). Do not edit
CreateModel(Model * model)2 void CreateModel(Model *model) {
3 OperandType type3(Type::INT32, {});
4 OperandType type1(Type::TENSOR_FLOAT32, {1, 1});
5 OperandType type2(Type::TENSOR_FLOAT32, {1});
6 OperandType type0(Type::TENSOR_FLOAT32, {3, 1});
7 // Phase 1, operands
8 auto op1 = model->addOperand(&type0);
9 auto op2 = model->addOperand(&type1);
10 auto b0 = model->addOperand(&type2);
11 auto op3 = model->addOperand(&type0);
12 auto act = model->addOperand(&type3);
13 // Phase 2, operations
14 static float op2_init[] = {2.0f};
15 model->setOperandValue(op2, op2_init, sizeof(float) * 1);
16 static float b0_init[] = {4.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 assert(model->isValid());
26 }
27
is_ignored(int i)28 bool is_ignored(int i) {
29 static std::set<int> ignore = {};
30 return ignore.find(i) != ignore.end();
31 }
32