1 // clang-format off
2 // Generated file (from: fully_connected_quant8_weights_as_inputs.mod.py). Do not edit
CreateModel(Model * model)3 void CreateModel(Model *model) {
4   OperandType type0(Type::TENSOR_QUANT8_ASYMM, {3, 1}, 0.5f, 0);
5   OperandType type1(Type::TENSOR_QUANT8_ASYMM, {1, 1}, 0.5f, 0);
6   OperandType type2(Type::TENSOR_INT32, {1}, 0.25f, 0);
7   OperandType type3(Type::TENSOR_QUANT8_ASYMM, {3, 1}, 1.0f, 0);
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 = model->addOperand(&type4);
14   auto op3 = model->addOperand(&type3);
15   // Phase 2, operations
16   static int32_t act_init[] = {0};
17   model->setOperandValue(act, act_init, sizeof(int32_t) * 1);
18   model->addOperation(ANEURALNETWORKS_FULLY_CONNECTED, {op1, op2, b0, act}, {op3});
19   // Phase 3, inputs and outputs
20   model->identifyInputsAndOutputs(
21     {op1, op2, b0},
22     {op3});
23   assert(model->isValid());
24 }
25 
is_ignored(int i)26 inline bool is_ignored(int i) {
27   static std::set<int> ignore = {};
28   return ignore.find(i) != ignore.end();
29 }
30 
CreateModel_dynamic_output_shape(Model * model)31 void CreateModel_dynamic_output_shape(Model *model) {
32   OperandType type0(Type::TENSOR_QUANT8_ASYMM, {3, 1}, 0.5f, 0);
33   OperandType type1(Type::TENSOR_QUANT8_ASYMM, {1, 1}, 0.5f, 0);
34   OperandType type2(Type::TENSOR_INT32, {1}, 0.25f, 0);
35   OperandType type4(Type::INT32, {});
36   OperandType type5(Type::TENSOR_QUANT8_ASYMM, {0, 0}, 1.0f, 0);
37   // Phase 1, operands
38   auto op1 = model->addOperand(&type0);
39   auto op2 = model->addOperand(&type1);
40   auto b0 = model->addOperand(&type2);
41   auto act = model->addOperand(&type4);
42   auto op3 = model->addOperand(&type5);
43   // Phase 2, operations
44   static int32_t act_init[] = {0};
45   model->setOperandValue(act, act_init, sizeof(int32_t) * 1);
46   model->addOperation(ANEURALNETWORKS_FULLY_CONNECTED, {op1, op2, b0, act}, {op3});
47   // Phase 3, inputs and outputs
48   model->identifyInputsAndOutputs(
49     {op1, op2, b0},
50     {op3});
51   assert(model->isValid());
52 }
53 
is_ignored_dynamic_output_shape(int i)54 inline bool is_ignored_dynamic_output_shape(int i) {
55   static std::set<int> ignore = {};
56   return ignore.find(i) != ignore.end();
57 }
58 
59