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