1 // clang-format off
2 // Generated file (from: l2_pool_float.mod.py). Do not edit
CreateModel(Model * model)3 void CreateModel(Model *model) {
4 OperandType type0(Type::TENSOR_FLOAT32, {1, 2, 2, 1});
5 OperandType type1(Type::INT32, {});
6 // Phase 1, operands
7 auto op1 = model->addOperand(&type0);
8 auto pad0 = model->addOperand(&type1);
9 auto cons1 = model->addOperand(&type1);
10 auto act = model->addOperand(&type1);
11 auto op3 = model->addOperand(&type0);
12 // Phase 2, operations
13 static int32_t pad0_init[] = {0};
14 model->setOperandValue(pad0, pad0_init, sizeof(int32_t) * 1);
15 static int32_t cons1_init[] = {1};
16 model->setOperandValue(cons1, cons1_init, sizeof(int32_t) * 1);
17 static int32_t act_init[] = {0};
18 model->setOperandValue(act, act_init, sizeof(int32_t) * 1);
19 model->addOperation(ANEURALNETWORKS_L2_POOL_2D, {op1, pad0, pad0, pad0, pad0, cons1, cons1, cons1, cons1, act}, {op3});
20 // Phase 3, inputs and outputs
21 model->identifyInputsAndOutputs(
22 {op1},
23 {op3});
24 assert(model->isValid());
25 }
26
is_ignored(int i)27 inline bool is_ignored(int i) {
28 static std::set<int> ignore = {};
29 return ignore.find(i) != ignore.end();
30 }
31
CreateModel_dynamic_output_shape(Model * model)32 void CreateModel_dynamic_output_shape(Model *model) {
33 OperandType type0(Type::TENSOR_FLOAT32, {1, 2, 2, 1});
34 OperandType type1(Type::INT32, {});
35 OperandType type2(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
36 // Phase 1, operands
37 auto op1 = model->addOperand(&type0);
38 auto pad0 = model->addOperand(&type1);
39 auto cons1 = model->addOperand(&type1);
40 auto act = model->addOperand(&type1);
41 auto op3 = model->addOperand(&type2);
42 // Phase 2, operations
43 static int32_t pad0_init[] = {0};
44 model->setOperandValue(pad0, pad0_init, sizeof(int32_t) * 1);
45 static int32_t cons1_init[] = {1};
46 model->setOperandValue(cons1, cons1_init, sizeof(int32_t) * 1);
47 static int32_t act_init[] = {0};
48 model->setOperandValue(act, act_init, sizeof(int32_t) * 1);
49 model->addOperation(ANEURALNETWORKS_L2_POOL_2D, {op1, pad0, pad0, pad0, pad0, cons1, cons1, cons1, cons1, act}, {op3});
50 // Phase 3, inputs and outputs
51 model->identifyInputsAndOutputs(
52 {op1},
53 {op3});
54 assert(model->isValid());
55 }
56
is_ignored_dynamic_output_shape(int i)57 inline bool is_ignored_dynamic_output_shape(int i) {
58 static std::set<int> ignore = {};
59 return ignore.find(i) != ignore.end();
60 }
61
62