Home | History | Annotate | Download | only in models
      1 // clang-format off
      2 // Generated file (from: split_quant8_4.mod.py). Do not edit
      3 void CreateModel(Model *model) {
      4   OperandType type0(Type::TENSOR_QUANT8_ASYMM, {2, 2, 2}, 1.0f, 0);
      5   OperandType type1(Type::INT32, {});
      6   OperandType type2(Type::TENSOR_QUANT8_ASYMM, {2, 1, 2}, 1.0f, 0);
      7   // Phase 1, operands
      8   auto input0 = model->addOperand(&type0);
      9   auto axis = model->addOperand(&type1);
     10   auto num_splits = model->addOperand(&type1);
     11   auto output0 = model->addOperand(&type2);
     12   auto output1 = model->addOperand(&type2);
     13   // Phase 2, operations
     14   static int32_t axis_init[] = {1};
     15   model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
     16   static int32_t num_splits_init[] = {2};
     17   model->setOperandValue(num_splits, num_splits_init, sizeof(int32_t) * 1);
     18   model->addOperation(ANEURALNETWORKS_SPLIT, {input0, axis, num_splits}, {output0, output1});
     19   // Phase 3, inputs and outputs
     20   model->identifyInputsAndOutputs(
     21     {input0},
     22     {output0, output1});
     23   assert(model->isValid());
     24 }
     25 
     26 inline bool is_ignored(int i) {
     27   static std::set<int> ignore = {};
     28   return ignore.find(i) != ignore.end();
     29 }
     30 
     31 void CreateModel_dynamic_output_shape(Model *model) {
     32   OperandType type0(Type::TENSOR_QUANT8_ASYMM, {2, 2, 2}, 1.0f, 0);
     33   OperandType type1(Type::INT32, {});
     34   OperandType type3(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0}, 1.0f, 0);
     35   // Phase 1, operands
     36   auto input0 = model->addOperand(&type0);
     37   auto axis = model->addOperand(&type1);
     38   auto num_splits = model->addOperand(&type1);
     39   auto output0 = model->addOperand(&type3);
     40   auto output1 = model->addOperand(&type3);
     41   // Phase 2, operations
     42   static int32_t axis_init[] = {1};
     43   model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
     44   static int32_t num_splits_init[] = {2};
     45   model->setOperandValue(num_splits, num_splits_init, sizeof(int32_t) * 1);
     46   model->addOperation(ANEURALNETWORKS_SPLIT, {input0, axis, num_splits}, {output0, output1});
     47   // Phase 3, inputs and outputs
     48   model->identifyInputsAndOutputs(
     49     {input0},
     50     {output0, output1});
     51   assert(model->isValid());
     52 }
     53 
     54 inline bool is_ignored_dynamic_output_shape(int i) {
     55   static std::set<int> ignore = {};
     56   return ignore.find(i) != ignore.end();
     57 }
     58 
     59