Home | History | Annotate | Download | only in models
      1 // Generated file (from: avg_pool_float_3_relaxed.mod.py). Do not edit
      2 void CreateModel(Model *model) {
      3   OperandType type1(Type::INT32, {});
      4   OperandType type0(Type::TENSOR_FLOAT32, {1, 200, 180, 1});
      5   OperandType type2(Type::TENSOR_FLOAT32, {1, 96, 86, 1});
      6   // 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[] = {2};
     15   model->setOperandValue(stride, stride_init, sizeof(int32_t) * 1);
     16   static int32_t filter_init[] = {10};
     17   model->setOperandValue(filter, filter_init, sizeof(int32_t) * 1);
     18   static int32_t padding_init[] = {0};
     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
     24   model->identifyInputsAndOutputs(
     25     {i0},
     26     {output});
     27   // Phase 4: set relaxed execution
     28   model->relaxComputationFloat32toFloat16(true);
     29   assert(model->isValid());
     30 }
     31 
     32 bool is_ignored(int i) {
     33   static std::set<int> ignore = {};
     34   return ignore.find(i) != ignore.end();
     35 }
     36