1 // clang-format off
2 // Generated file (from: fully_connected_quant8_2.mod.py). Do not edit
CreateModel(Model * model)3 void CreateModel(Model *model) {
4 OperandType type0(Type::TENSOR_QUANT8_ASYMM, {4, 1, 5, 1}, 0.5f, 127);
5 OperandType type1(Type::TENSOR_QUANT8_ASYMM, {3, 10}, 0.5f, 127);
6 OperandType type2(Type::TENSOR_INT32, {3}, 0.25f, 0);
7 OperandType type3(Type::TENSOR_QUANT8_ASYMM, {2, 3}, 1.0f, 127);
8 OperandType type4(Type::INT32, {});
9 // Phase 1, operands
10 auto op1 = model->addOperand(&type0);
11 auto op2 = model->addOperand(&type1);
12 auto b0 = model->addOperand(&type2);
13 auto act_relu = model->addOperand(&type4);
14 auto op3 = model->addOperand(&type3);
15 // Phase 2, operations
16 static uint8_t op2_init[] = {129, 131, 133, 135, 137, 139, 141, 143, 145, 147, 129, 131, 133, 135, 137, 139, 141, 143, 145, 147, 129, 131, 133, 135, 137, 139, 141, 143, 145, 147};
17 model->setOperandValue(op2, op2_init, sizeof(uint8_t) * 30);
18 static int32_t b0_init[] = {4, 8, 12};
19 model->setOperandValue(b0, b0_init, sizeof(int32_t) * 3);
20 static int32_t act_relu_init[] = {1};
21 model->setOperandValue(act_relu, act_relu_init, sizeof(int32_t) * 1);
22 model->addOperation(ANEURALNETWORKS_FULLY_CONNECTED, {op1, op2, b0, act_relu}, {op3});
23 // Phase 3, inputs and outputs
24 model->identifyInputsAndOutputs(
25 {op1},
26 {op3});
27 assert(model->isValid());
28 }
29
is_ignored(int i)30 inline bool is_ignored(int i) {
31 static std::set<int> ignore = {};
32 return ignore.find(i) != ignore.end();
33 }
34
CreateModel_dynamic_output_shape(Model * model)35 void CreateModel_dynamic_output_shape(Model *model) {
36 OperandType type0(Type::TENSOR_QUANT8_ASYMM, {4, 1, 5, 1}, 0.5f, 127);
37 OperandType type1(Type::TENSOR_QUANT8_ASYMM, {3, 10}, 0.5f, 127);
38 OperandType type2(Type::TENSOR_INT32, {3}, 0.25f, 0);
39 OperandType type4(Type::INT32, {});
40 OperandType type5(Type::TENSOR_QUANT8_ASYMM, {0, 0}, 1.0f, 127);
41 // Phase 1, operands
42 auto op1 = model->addOperand(&type0);
43 auto op2 = model->addOperand(&type1);
44 auto b0 = model->addOperand(&type2);
45 auto act_relu = model->addOperand(&type4);
46 auto op3 = model->addOperand(&type5);
47 // Phase 2, operations
48 static uint8_t op2_init[] = {129, 131, 133, 135, 137, 139, 141, 143, 145, 147, 129, 131, 133, 135, 137, 139, 141, 143, 145, 147, 129, 131, 133, 135, 137, 139, 141, 143, 145, 147};
49 model->setOperandValue(op2, op2_init, sizeof(uint8_t) * 30);
50 static int32_t b0_init[] = {4, 8, 12};
51 model->setOperandValue(b0, b0_init, sizeof(int32_t) * 3);
52 static int32_t act_relu_init[] = {1};
53 model->setOperandValue(act_relu, act_relu_init, sizeof(int32_t) * 1);
54 model->addOperation(ANEURALNETWORKS_FULLY_CONNECTED, {op1, op2, b0, act_relu}, {op3});
55 // Phase 3, inputs and outputs
56 model->identifyInputsAndOutputs(
57 {op1},
58 {op3});
59 assert(model->isValid());
60 }
61
is_ignored_dynamic_output_shape(int i)62 inline bool is_ignored_dynamic_output_shape(int i) {
63 static std::set<int> ignore = {};
64 return ignore.find(i) != ignore.end();
65 }
66
67