1 // Generated file (from: depthwise_conv_relaxed.mod.py). Do not edit
CreateModel(Model * model)2 void CreateModel(Model *model) {
3   OperandType type0(Type::INT32, {});
4   OperandType type2(Type::TENSOR_FLOAT32, {1, 1, 1, 3});
5   OperandType type1(Type::TENSOR_FLOAT32, {1, 8, 8, 3});
6   OperandType type3(Type::TENSOR_FLOAT32, {3});
7   // Phase 1, operands
8   auto b4 = model->addOperand(&type0);
9   auto b5 = model->addOperand(&type0);
10   auto b6 = model->addOperand(&type0);
11   auto b7 = model->addOperand(&type0);
12   auto b8 = model->addOperand(&type0);
13   auto op2 = model->addOperand(&type1);
14   auto op3 = model->addOperand(&type1);
15   auto op0 = model->addOperand(&type2);
16   auto op1 = model->addOperand(&type3);
17   // Phase 2, operations
18   static int32_t b4_init[] = {1};
19   model->setOperandValue(b4, b4_init, sizeof(int32_t) * 1);
20   static int32_t b5_init[] = {1};
21   model->setOperandValue(b5, b5_init, sizeof(int32_t) * 1);
22   static int32_t b6_init[] = {1};
23   model->setOperandValue(b6, b6_init, sizeof(int32_t) * 1);
24   static int32_t b7_init[] = {1};
25   model->setOperandValue(b7, b7_init, sizeof(int32_t) * 1);
26   static int32_t b8_init[] = {0};
27   model->setOperandValue(b8, b8_init, sizeof(int32_t) * 1);
28   static float op0_init[] = {-0.966213f, -0.467474f, -0.82203f};
29   model->setOperandValue(op0, op0_init, sizeof(float) * 3);
30   static float op1_init[] = {0.0f, 0.0f, 0.0f};
31   model->setOperandValue(op1, op1_init, sizeof(float) * 3);
32   model->addOperation(ANEURALNETWORKS_DEPTHWISE_CONV_2D, {op2, op0, op1, b4, b5, b6, b7, b8}, {op3});
33   // Phase 3, inputs and outputs
34   model->identifyInputsAndOutputs(
35     {op2},
36     {op3});
37   assert(model->isValid());
38 }
39 
is_ignored(int i)40 bool is_ignored(int i) {
41   static std::set<int> ignore = {};
42   return ignore.find(i) != ignore.end();
43 }
44