blob: f6f2e5b90facc90a7c877b6953a2fe9cf67cf359 [file] [log] [blame]
Dong Chen224c01e2017-10-03 10:38:55 -07001// Generated file (from: avg_pool_float_2.mod.py). Do not edit
2void CreateModel(Model *model) {
3 OperandType type1(Type::INT32, {});
Jean-Luc Brouillete68d9242017-10-04 00:49:53 -07004 OperandType type2(Type::TENSOR_FLOAT32, {5, 11, 13, 3});
5 OperandType type0(Type::TENSOR_FLOAT32, {5, 52, 60, 3});
Dong Chen224c01e2017-10-03 10:38:55 -07006 // Phase 1, operands
7 auto i0 = model->addOperand(&type0);
8 auto stride = model->addOperand(&type1);
9 auto filter = model->addOperand(&type1);
10 auto padding = model->addOperand(&type1);
11 auto activation = model->addOperand(&type1);
12 auto output = model->addOperand(&type2);
13 // Phase 2, operations
14 static int32_t stride_init[] = {5};
15 model->setOperandValue(stride, stride_init, sizeof(int32_t) * 1);
16 static int32_t filter_init[] = {100};
17 model->setOperandValue(filter, filter_init, sizeof(int32_t) * 1);
18 static int32_t padding_init[] = {50};
19 model->setOperandValue(padding, padding_init, sizeof(int32_t) * 1);
20 static int32_t activation_init[] = {0};
21 model->setOperandValue(activation, activation_init, sizeof(int32_t) * 1);
22 model->addOperation(ANEURALNETWORKS_AVERAGE_POOL_2D, {i0, padding, padding, padding, padding, stride, stride, filter, filter, activation}, {output});
23 // Phase 3, inputs and outputs
Jean-Luc Brouillet66d5cb62017-10-04 20:41:35 -070024 model->identifyInputsAndOutputs(
Dong Chen224c01e2017-10-03 10:38:55 -070025 {i0},
26 {output});
27 assert(model->isValid());
28}
29
30bool is_ignored(int i) {
31 static std::set<int> ignore = {};
32 return ignore.find(i) != ignore.end();
33}