Home | History | Annotate | Download | only in vts_models
      1 // clang-format off
      2 // Generated file (from: tile_3.mod.py). Do not edit
      3 // Create the model
      4 Model createTestModel() {
      5     const std::vector<Operand> operands = {
      6         {
      7             .type = OperandType::TENSOR_FLOAT32,
      8             .dimensions = {1, 2, 3},
      9             .numberOfConsumers = 1,
     10             .scale = 0.0f,
     11             .zeroPoint = 0,
     12             .lifetime = OperandLifeTime::MODEL_INPUT,
     13             .location = {.poolIndex = 0, .offset = 0, .length = 0},
     14         },
     15         {
     16             .type = OperandType::TENSOR_INT32,
     17             .dimensions = {3},
     18             .numberOfConsumers = 1,
     19             .scale = 0.0f,
     20             .zeroPoint = 0,
     21             .lifetime = OperandLifeTime::MODEL_INPUT,
     22             .location = {.poolIndex = 0, .offset = 0, .length = 0},
     23         },
     24         {
     25             .type = OperandType::TENSOR_FLOAT32,
     26             .dimensions = {2, 6, 3},
     27             .numberOfConsumers = 0,
     28             .scale = 0.0f,
     29             .zeroPoint = 0,
     30             .lifetime = OperandLifeTime::MODEL_OUTPUT,
     31             .location = {.poolIndex = 0, .offset = 0, .length = 0},
     32         }
     33     };
     34 
     35     const std::vector<Operation> operations = {
     36         {
     37             .type = OperationType::TILE,
     38             .inputs = {0, 1},
     39             .outputs = {2},
     40         }
     41     };
     42 
     43     const std::vector<uint32_t> inputIndexes = {0, 1};
     44     const std::vector<uint32_t> outputIndexes = {2};
     45     std::vector<uint8_t> operandValues = {};
     46     const std::vector<hidl_memory> pools = {};
     47 
     48     return {
     49         .operands = operands,
     50         .operations = operations,
     51         .inputIndexes = inputIndexes,
     52         .outputIndexes = outputIndexes,
     53         .operandValues = operandValues,
     54         .pools = pools,
     55     };
     56 }
     57 
     58 inline bool is_ignored(int i) {
     59   static std::set<int> ignore = {};
     60   return ignore.find(i) != ignore.end();
     61 }
     62 
     63 // Create the model
     64 Model createTestModel_relaxed() {
     65     const std::vector<Operand> operands = {
     66         {
     67             .type = OperandType::TENSOR_FLOAT32,
     68             .dimensions = {1, 2, 3},
     69             .numberOfConsumers = 1,
     70             .scale = 0.0f,
     71             .zeroPoint = 0,
     72             .lifetime = OperandLifeTime::MODEL_INPUT,
     73             .location = {.poolIndex = 0, .offset = 0, .length = 0},
     74         },
     75         {
     76             .type = OperandType::TENSOR_INT32,
     77             .dimensions = {3},
     78             .numberOfConsumers = 1,
     79             .scale = 0.0f,
     80             .zeroPoint = 0,
     81             .lifetime = OperandLifeTime::MODEL_INPUT,
     82             .location = {.poolIndex = 0, .offset = 0, .length = 0},
     83         },
     84         {
     85             .type = OperandType::TENSOR_FLOAT32,
     86             .dimensions = {2, 6, 3},
     87             .numberOfConsumers = 0,
     88             .scale = 0.0f,
     89             .zeroPoint = 0,
     90             .lifetime = OperandLifeTime::MODEL_OUTPUT,
     91             .location = {.poolIndex = 0, .offset = 0, .length = 0},
     92         }
     93     };
     94 
     95     const std::vector<Operation> operations = {
     96         {
     97             .type = OperationType::TILE,
     98             .inputs = {0, 1},
     99             .outputs = {2},
    100         }
    101     };
    102 
    103     const std::vector<uint32_t> inputIndexes = {0, 1};
    104     const std::vector<uint32_t> outputIndexes = {2};
    105     std::vector<uint8_t> operandValues = {};
    106     const std::vector<hidl_memory> pools = {};
    107 
    108     return {
    109         .operands = operands,
    110         .operations = operations,
    111         .inputIndexes = inputIndexes,
    112         .outputIndexes = outputIndexes,
    113         .operandValues = operandValues,
    114         .pools = pools,
    115         .relaxComputationFloat32toFloat16 = true,
    116     };
    117 }
    118 
    119 inline bool is_ignored_relaxed(int i) {
    120   static std::set<int> ignore = {};
    121   return ignore.find(i) != ignore.end();
    122 }
    123 
    124 // Create the model
    125 Model createTestModel_float16() {
    126     const std::vector<Operand> operands = {
    127         {
    128             .type = OperandType::TENSOR_FLOAT16,
    129             .dimensions = {1, 2, 3},
    130             .numberOfConsumers = 1,
    131             .scale = 0.0f,
    132             .zeroPoint = 0,
    133             .lifetime = OperandLifeTime::MODEL_INPUT,
    134             .location = {.poolIndex = 0, .offset = 0, .length = 0},
    135         },
    136         {
    137             .type = OperandType::TENSOR_INT32,
    138             .dimensions = {3},
    139             .numberOfConsumers = 1,
    140             .scale = 0.0f,
    141             .zeroPoint = 0,
    142             .lifetime = OperandLifeTime::MODEL_INPUT,
    143             .location = {.poolIndex = 0, .offset = 0, .length = 0},
    144         },
    145         {
    146             .type = OperandType::TENSOR_FLOAT16,
    147             .dimensions = {2, 6, 3},
    148             .numberOfConsumers = 0,
    149             .scale = 0.0f,
    150             .zeroPoint = 0,
    151             .lifetime = OperandLifeTime::MODEL_OUTPUT,
    152             .location = {.poolIndex = 0, .offset = 0, .length = 0},
    153         }
    154     };
    155 
    156     const std::vector<Operation> operations = {
    157         {
    158             .type = OperationType::TILE,
    159             .inputs = {0, 1},
    160             .outputs = {2},
    161         }
    162     };
    163 
    164     const std::vector<uint32_t> inputIndexes = {0, 1};
    165     const std::vector<uint32_t> outputIndexes = {2};
    166     std::vector<uint8_t> operandValues = {};
    167     const std::vector<hidl_memory> pools = {};
    168 
    169     return {
    170         .operands = operands,
    171         .operations = operations,
    172         .inputIndexes = inputIndexes,
    173         .outputIndexes = outputIndexes,
    174         .operandValues = operandValues,
    175         .pools = pools,
    176     };
    177 }
    178 
    179 inline bool is_ignored_float16(int i) {
    180   static std::set<int> ignore = {};
    181   return ignore.find(i) != ignore.end();
    182 }
    183 
    184 // Create the model
    185 Model createTestModel_quant8() {
    186     const std::vector<Operand> operands = {
    187         {
    188             .type = OperandType::TENSOR_QUANT8_ASYMM,
    189             .dimensions = {1, 2, 3},
    190             .numberOfConsumers = 1,
    191             .scale = 0.5f,
    192             .zeroPoint = 127,
    193             .lifetime = OperandLifeTime::MODEL_INPUT,
    194             .location = {.poolIndex = 0, .offset = 0, .length = 0},
    195         },
    196         {
    197             .type = OperandType::TENSOR_INT32,
    198             .dimensions = {3},
    199             .numberOfConsumers = 1,
    200             .scale = 0.0f,
    201             .zeroPoint = 0,
    202             .lifetime = OperandLifeTime::MODEL_INPUT,
    203             .location = {.poolIndex = 0, .offset = 0, .length = 0},
    204         },
    205         {
    206             .type = OperandType::TENSOR_QUANT8_ASYMM,
    207             .dimensions = {2, 6, 3},
    208             .numberOfConsumers = 0,
    209             .scale = 0.5f,
    210             .zeroPoint = 127,
    211             .lifetime = OperandLifeTime::MODEL_OUTPUT,
    212             .location = {.poolIndex = 0, .offset = 0, .length = 0},
    213         }
    214     };
    215 
    216     const std::vector<Operation> operations = {
    217         {
    218             .type = OperationType::TILE,
    219             .inputs = {0, 1},
    220             .outputs = {2},
    221         }
    222     };
    223 
    224     const std::vector<uint32_t> inputIndexes = {0, 1};
    225     const std::vector<uint32_t> outputIndexes = {2};
    226     std::vector<uint8_t> operandValues = {};
    227     const std::vector<hidl_memory> pools = {};
    228 
    229     return {
    230         .operands = operands,
    231         .operations = operations,
    232         .inputIndexes = inputIndexes,
    233         .outputIndexes = outputIndexes,
    234         .operandValues = operandValues,
    235         .pools = pools,
    236     };
    237 }
    238 
    239 inline bool is_ignored_quant8(int i) {
    240   static std::set<int> ignore = {};
    241   return ignore.find(i) != ignore.end();
    242 }
    243 
    244 // Create the model
    245 Model createTestModel_int32() {
    246     const std::vector<Operand> operands = {
    247         {
    248             .type = OperandType::TENSOR_INT32,
    249             .dimensions = {1, 2, 3},
    250             .numberOfConsumers = 1,
    251             .scale = 0.0f,
    252             .zeroPoint = 0,
    253             .lifetime = OperandLifeTime::MODEL_INPUT,
    254             .location = {.poolIndex = 0, .offset = 0, .length = 0},
    255         },
    256         {
    257             .type = OperandType::TENSOR_INT32,
    258             .dimensions = {3},
    259             .numberOfConsumers = 1,
    260             .scale = 0.0f,
    261             .zeroPoint = 0,
    262             .lifetime = OperandLifeTime::MODEL_INPUT,
    263             .location = {.poolIndex = 0, .offset = 0, .length = 0},
    264         },
    265         {
    266             .type = OperandType::TENSOR_INT32,
    267             .dimensions = {2, 6, 3},
    268             .numberOfConsumers = 0,
    269             .scale = 0.0f,
    270             .zeroPoint = 0,
    271             .lifetime = OperandLifeTime::MODEL_OUTPUT,
    272             .location = {.poolIndex = 0, .offset = 0, .length = 0},
    273         }
    274     };
    275 
    276     const std::vector<Operation> operations = {
    277         {
    278             .type = OperationType::TILE,
    279             .inputs = {0, 1},
    280             .outputs = {2},
    281         }
    282     };
    283 
    284     const std::vector<uint32_t> inputIndexes = {0, 1};
    285     const std::vector<uint32_t> outputIndexes = {2};
    286     std::vector<uint8_t> operandValues = {};
    287     const std::vector<hidl_memory> pools = {};
    288 
    289     return {
    290         .operands = operands,
    291         .operations = operations,
    292         .inputIndexes = inputIndexes,
    293         .outputIndexes = outputIndexes,
    294         .operandValues = operandValues,
    295         .pools = pools,
    296     };
    297 }
    298 
    299 inline bool is_ignored_int32(int i) {
    300   static std::set<int> ignore = {};
    301   return ignore.find(i) != ignore.end();
    302 }
    303 
    304 // Create the model
    305 Model createTestModel_dynamic_output_shape() {
    306     const std::vector<Operand> operands = {
    307         {
    308             .type = OperandType::TENSOR_FLOAT32,
    309             .dimensions = {1, 2, 3},
    310             .numberOfConsumers = 1,
    311             .scale = 0.0f,
    312             .zeroPoint = 0,
    313             .lifetime = OperandLifeTime::MODEL_INPUT,
    314             .location = {.poolIndex = 0, .offset = 0, .length = 0},
    315         },
    316         {
    317             .type = OperandType::TENSOR_INT32,
    318             .dimensions = {3},
    319             .numberOfConsumers = 1,
    320             .scale = 0.0f,
    321             .zeroPoint = 0,
    322             .lifetime = OperandLifeTime::MODEL_INPUT,
    323             .location = {.poolIndex = 0, .offset = 0, .length = 0},
    324         },
    325         {
    326             .type = OperandType::TENSOR_FLOAT32,
    327             .dimensions = {0, 0, 0},
    328             .numberOfConsumers = 0,
    329             .scale = 0.0f,
    330             .zeroPoint = 0,
    331             .lifetime = OperandLifeTime::MODEL_OUTPUT,
    332             .location = {.poolIndex = 0, .offset = 0, .length = 0},
    333         }
    334     };
    335 
    336     const std::vector<Operation> operations = {
    337         {
    338             .type = OperationType::TILE,
    339             .inputs = {0, 1},
    340             .outputs = {2},
    341         }
    342     };
    343 
    344     const std::vector<uint32_t> inputIndexes = {0, 1};
    345     const std::vector<uint32_t> outputIndexes = {2};
    346     std::vector<uint8_t> operandValues = {};
    347     const std::vector<hidl_memory> pools = {};
    348 
    349     return {
    350         .operands = operands,
    351         .operations = operations,
    352         .inputIndexes = inputIndexes,
    353         .outputIndexes = outputIndexes,
    354         .operandValues = operandValues,
    355         .pools = pools,
    356     };
    357 }
    358 
    359 inline bool is_ignored_dynamic_output_shape(int i) {
    360   static std::set<int> ignore = {};
    361   return ignore.find(i) != ignore.end();
    362 }
    363 
    364 // Create the model
    365 Model createTestModel_dynamic_output_shape_relaxed() {
    366     const std::vector<Operand> operands = {
    367         {
    368             .type = OperandType::TENSOR_FLOAT32,
    369             .dimensions = {1, 2, 3},
    370             .numberOfConsumers = 1,
    371             .scale = 0.0f,
    372             .zeroPoint = 0,
    373             .lifetime = OperandLifeTime::MODEL_INPUT,
    374             .location = {.poolIndex = 0, .offset = 0, .length = 0},
    375         },
    376         {
    377             .type = OperandType::TENSOR_INT32,
    378             .dimensions = {3},
    379             .numberOfConsumers = 1,
    380             .scale = 0.0f,
    381             .zeroPoint = 0,
    382             .lifetime = OperandLifeTime::MODEL_INPUT,
    383             .location = {.poolIndex = 0, .offset = 0, .length = 0},
    384         },
    385         {
    386             .type = OperandType::TENSOR_FLOAT32,
    387             .dimensions = {0, 0, 0},
    388             .numberOfConsumers = 0,
    389             .scale = 0.0f,
    390             .zeroPoint = 0,
    391             .lifetime = OperandLifeTime::MODEL_OUTPUT,
    392             .location = {.poolIndex = 0, .offset = 0, .length = 0},
    393         }
    394     };
    395 
    396     const std::vector<Operation> operations = {
    397         {
    398             .type = OperationType::TILE,
    399             .inputs = {0, 1},
    400             .outputs = {2},
    401         }
    402     };
    403 
    404     const std::vector<uint32_t> inputIndexes = {0, 1};
    405     const std::vector<uint32_t> outputIndexes = {2};
    406     std::vector<uint8_t> operandValues = {};
    407     const std::vector<hidl_memory> pools = {};
    408 
    409     return {
    410         .operands = operands,
    411         .operations = operations,
    412         .inputIndexes = inputIndexes,
    413         .outputIndexes = outputIndexes,
    414         .operandValues = operandValues,
    415         .pools = pools,
    416         .relaxComputationFloat32toFloat16 = true,
    417     };
    418 }
    419 
    420 inline bool is_ignored_dynamic_output_shape_relaxed(int i) {
    421   static std::set<int> ignore = {};
    422   return ignore.find(i) != ignore.end();
    423 }
    424 
    425 // Create the model
    426 Model createTestModel_dynamic_output_shape_float16() {
    427     const std::vector<Operand> operands = {
    428         {
    429             .type = OperandType::TENSOR_FLOAT16,
    430             .dimensions = {1, 2, 3},
    431             .numberOfConsumers = 1,
    432             .scale = 0.0f,
    433             .zeroPoint = 0,
    434             .lifetime = OperandLifeTime::MODEL_INPUT,
    435             .location = {.poolIndex = 0, .offset = 0, .length = 0},
    436         },
    437         {
    438             .type = OperandType::TENSOR_INT32,
    439             .dimensions = {3},
    440             .numberOfConsumers = 1,
    441             .scale = 0.0f,
    442             .zeroPoint = 0,
    443             .lifetime = OperandLifeTime::MODEL_INPUT,
    444             .location = {.poolIndex = 0, .offset = 0, .length = 0},
    445         },
    446         {
    447             .type = OperandType::TENSOR_FLOAT16,
    448             .dimensions = {0, 0, 0},
    449             .numberOfConsumers = 0,
    450             .scale = 0.0f,
    451             .zeroPoint = 0,
    452             .lifetime = OperandLifeTime::MODEL_OUTPUT,
    453             .location = {.poolIndex = 0, .offset = 0, .length = 0},
    454         }
    455     };
    456 
    457     const std::vector<Operation> operations = {
    458         {
    459             .type = OperationType::TILE,
    460             .inputs = {0, 1},
    461             .outputs = {2},
    462         }
    463     };
    464 
    465     const std::vector<uint32_t> inputIndexes = {0, 1};
    466     const std::vector<uint32_t> outputIndexes = {2};
    467     std::vector<uint8_t> operandValues = {};
    468     const std::vector<hidl_memory> pools = {};
    469 
    470     return {
    471         .operands = operands,
    472         .operations = operations,
    473         .inputIndexes = inputIndexes,
    474         .outputIndexes = outputIndexes,
    475         .operandValues = operandValues,
    476         .pools = pools,
    477     };
    478 }
    479 
    480 inline bool is_ignored_dynamic_output_shape_float16(int i) {
    481   static std::set<int> ignore = {};
    482   return ignore.find(i) != ignore.end();
    483 }
    484 
    485 // Create the model
    486 Model createTestModel_dynamic_output_shape_quant8() {
    487     const std::vector<Operand> operands = {
    488         {
    489             .type = OperandType::TENSOR_QUANT8_ASYMM,
    490             .dimensions = {1, 2, 3},
    491             .numberOfConsumers = 1,
    492             .scale = 0.5f,
    493             .zeroPoint = 127,
    494             .lifetime = OperandLifeTime::MODEL_INPUT,
    495             .location = {.poolIndex = 0, .offset = 0, .length = 0},
    496         },
    497         {
    498             .type = OperandType::TENSOR_INT32,
    499             .dimensions = {3},
    500             .numberOfConsumers = 1,
    501             .scale = 0.0f,
    502             .zeroPoint = 0,
    503             .lifetime = OperandLifeTime::MODEL_INPUT,
    504             .location = {.poolIndex = 0, .offset = 0, .length = 0},
    505         },
    506         {
    507             .type = OperandType::TENSOR_QUANT8_ASYMM,
    508             .dimensions = {0, 0, 0},
    509             .numberOfConsumers = 0,
    510             .scale = 0.5f,
    511             .zeroPoint = 127,
    512             .lifetime = OperandLifeTime::MODEL_OUTPUT,
    513             .location = {.poolIndex = 0, .offset = 0, .length = 0},
    514         }
    515     };
    516 
    517     const std::vector<Operation> operations = {
    518         {
    519             .type = OperationType::TILE,
    520             .inputs = {0, 1},
    521             .outputs = {2},
    522         }
    523     };
    524 
    525     const std::vector<uint32_t> inputIndexes = {0, 1};
    526     const std::vector<uint32_t> outputIndexes = {2};
    527     std::vector<uint8_t> operandValues = {};
    528     const std::vector<hidl_memory> pools = {};
    529 
    530     return {
    531         .operands = operands,
    532         .operations = operations,
    533         .inputIndexes = inputIndexes,
    534         .outputIndexes = outputIndexes,
    535         .operandValues = operandValues,
    536         .pools = pools,
    537     };
    538 }
    539 
    540 inline bool is_ignored_dynamic_output_shape_quant8(int i) {
    541   static std::set<int> ignore = {};
    542   return ignore.find(i) != ignore.end();
    543 }
    544 
    545 // Create the model
    546 Model createTestModel_dynamic_output_shape_int32() {
    547     const std::vector<Operand> operands = {
    548         {
    549             .type = OperandType::TENSOR_INT32,
    550             .dimensions = {1, 2, 3},
    551             .numberOfConsumers = 1,
    552             .scale = 0.0f,
    553             .zeroPoint = 0,
    554             .lifetime = OperandLifeTime::MODEL_INPUT,
    555             .location = {.poolIndex = 0, .offset = 0, .length = 0},
    556         },
    557         {
    558             .type = OperandType::TENSOR_INT32,
    559             .dimensions = {3},
    560             .numberOfConsumers = 1,
    561             .scale = 0.0f,
    562             .zeroPoint = 0,
    563             .lifetime = OperandLifeTime::MODEL_INPUT,
    564             .location = {.poolIndex = 0, .offset = 0, .length = 0},
    565         },
    566         {
    567             .type = OperandType::TENSOR_INT32,
    568             .dimensions = {0, 0, 0},
    569             .numberOfConsumers = 0,
    570             .scale = 0.0f,
    571             .zeroPoint = 0,
    572             .lifetime = OperandLifeTime::MODEL_OUTPUT,
    573             .location = {.poolIndex = 0, .offset = 0, .length = 0},
    574         }
    575     };
    576 
    577     const std::vector<Operation> operations = {
    578         {
    579             .type = OperationType::TILE,
    580             .inputs = {0, 1},
    581             .outputs = {2},
    582         }
    583     };
    584 
    585     const std::vector<uint32_t> inputIndexes = {0, 1};
    586     const std::vector<uint32_t> outputIndexes = {2};
    587     std::vector<uint8_t> operandValues = {};
    588     const std::vector<hidl_memory> pools = {};
    589 
    590     return {
    591         .operands = operands,
    592         .operations = operations,
    593         .inputIndexes = inputIndexes,
    594         .outputIndexes = outputIndexes,
    595         .operandValues = operandValues,
    596         .pools = pools,
    597     };
    598 }
    599 
    600 inline bool is_ignored_dynamic_output_shape_int32(int i) {
    601   static std::set<int> ignore = {};
    602   return ignore.find(i) != ignore.end();
    603 }
    604 
    605