Home | History | Annotate | Download | only in models
      1 // Generated file (from: strided_slice.mod.py). Do not edit
      2 void CreateModel(Model *model) {
      3   OperandType type2(Type::INT32, {});
      4   OperandType type3(Type::TENSOR_FLOAT32, {1, 2});
      5   OperandType type0(Type::TENSOR_FLOAT32, {2, 3});
      6   OperandType type1(Type::TENSOR_INT32, {2});
      7   // Phase 1, operands
      8   auto input = model->addOperand(&type0);
      9   auto begins = model->addOperand(&type1);
     10   auto ends = model->addOperand(&type1);
     11   auto strides = model->addOperand(&type1);
     12   auto beginMask = model->addOperand(&type2);
     13   auto endMask = model->addOperand(&type2);
     14   auto shrinkAxisMask = model->addOperand(&type2);
     15   auto output = model->addOperand(&type3);
     16   // Phase 2, operations
     17   static int32_t begins_init[] = {0, 0};
     18   model->setOperandValue(begins, begins_init, sizeof(int32_t) * 2);
     19   static int32_t ends_init[] = {2, 3};
     20   model->setOperandValue(ends, ends_init, sizeof(int32_t) * 2);
     21   static int32_t strides_init[] = {2, 2};
     22   model->setOperandValue(strides, strides_init, sizeof(int32_t) * 2);
     23   static int32_t beginMask_init[] = {0};
     24   model->setOperandValue(beginMask, beginMask_init, sizeof(int32_t) * 1);
     25   static int32_t endMask_init[] = {0};
     26   model->setOperandValue(endMask, endMask_init, sizeof(int32_t) * 1);
     27   static int32_t shrinkAxisMask_init[] = {0};
     28   model->setOperandValue(shrinkAxisMask, shrinkAxisMask_init, sizeof(int32_t) * 1);
     29   model->addOperation(ANEURALNETWORKS_STRIDED_SLICE, {input, begins, ends, strides, beginMask, endMask, shrinkAxisMask}, {output});
     30   // Phase 3, inputs and outputs
     31   model->identifyInputsAndOutputs(
     32     {input},
     33     {output});
     34   assert(model->isValid());
     35 }
     36 
     37 bool is_ignored(int i) {
     38   static std::set<int> ignore = {};
     39   return ignore.find(i) != ignore.end();
     40 }
     41