Home | History | Annotate | Download | only in vts_models
      1 // clang-format off
      2 // Generated file (from: neg.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, 4, 5},
      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_FLOAT32,
     17             .dimensions = {1, 2, 3, 4, 5},
     18             .numberOfConsumers = 0,
     19             .scale = 0.0f,
     20             .zeroPoint = 0,
     21             .lifetime = OperandLifeTime::MODEL_OUTPUT,
     22             .location = {.poolIndex = 0, .offset = 0, .length = 0},
     23         }
     24     };
     25 
     26     const std::vector<Operation> operations = {
     27         {
     28             .type = OperationType::NEG,
     29             .inputs = {0},
     30             .outputs = {1},
     31         }
     32     };
     33 
     34     const std::vector<uint32_t> inputIndexes = {0};
     35     const std::vector<uint32_t> outputIndexes = {1};
     36     std::vector<uint8_t> operandValues = {};
     37     const std::vector<hidl_memory> pools = {};
     38 
     39     return {
     40         .operands = operands,
     41         .operations = operations,
     42         .inputIndexes = inputIndexes,
     43         .outputIndexes = outputIndexes,
     44         .operandValues = operandValues,
     45         .pools = pools,
     46     };
     47 }
     48 
     49 inline bool is_ignored(int i) {
     50   static std::set<int> ignore = {};
     51   return ignore.find(i) != ignore.end();
     52 }
     53 
     54 // Create the model
     55 Model createTestModel_relaxed() {
     56     const std::vector<Operand> operands = {
     57         {
     58             .type = OperandType::TENSOR_FLOAT32,
     59             .dimensions = {1, 2, 3, 4, 5},
     60             .numberOfConsumers = 1,
     61             .scale = 0.0f,
     62             .zeroPoint = 0,
     63             .lifetime = OperandLifeTime::MODEL_INPUT,
     64             .location = {.poolIndex = 0, .offset = 0, .length = 0},
     65         },
     66         {
     67             .type = OperandType::TENSOR_FLOAT32,
     68             .dimensions = {1, 2, 3, 4, 5},
     69             .numberOfConsumers = 0,
     70             .scale = 0.0f,
     71             .zeroPoint = 0,
     72             .lifetime = OperandLifeTime::MODEL_OUTPUT,
     73             .location = {.poolIndex = 0, .offset = 0, .length = 0},
     74         }
     75     };
     76 
     77     const std::vector<Operation> operations = {
     78         {
     79             .type = OperationType::NEG,
     80             .inputs = {0},
     81             .outputs = {1},
     82         }
     83     };
     84 
     85     const std::vector<uint32_t> inputIndexes = {0};
     86     const std::vector<uint32_t> outputIndexes = {1};
     87     std::vector<uint8_t> operandValues = {};
     88     const std::vector<hidl_memory> pools = {};
     89 
     90     return {
     91         .operands = operands,
     92         .operations = operations,
     93         .inputIndexes = inputIndexes,
     94         .outputIndexes = outputIndexes,
     95         .operandValues = operandValues,
     96         .pools = pools,
     97         .relaxComputationFloat32toFloat16 = true,
     98     };
     99 }
    100 
    101 inline bool is_ignored_relaxed(int i) {
    102   static std::set<int> ignore = {};
    103   return ignore.find(i) != ignore.end();
    104 }
    105 
    106 // Create the model
    107 Model createTestModel_float16() {
    108     const std::vector<Operand> operands = {
    109         {
    110             .type = OperandType::TENSOR_FLOAT16,
    111             .dimensions = {1, 2, 3, 4, 5},
    112             .numberOfConsumers = 1,
    113             .scale = 0.0f,
    114             .zeroPoint = 0,
    115             .lifetime = OperandLifeTime::MODEL_INPUT,
    116             .location = {.poolIndex = 0, .offset = 0, .length = 0},
    117         },
    118         {
    119             .type = OperandType::TENSOR_FLOAT16,
    120             .dimensions = {1, 2, 3, 4, 5},
    121             .numberOfConsumers = 0,
    122             .scale = 0.0f,
    123             .zeroPoint = 0,
    124             .lifetime = OperandLifeTime::MODEL_OUTPUT,
    125             .location = {.poolIndex = 0, .offset = 0, .length = 0},
    126         }
    127     };
    128 
    129     const std::vector<Operation> operations = {
    130         {
    131             .type = OperationType::NEG,
    132             .inputs = {0},
    133             .outputs = {1},
    134         }
    135     };
    136 
    137     const std::vector<uint32_t> inputIndexes = {0};
    138     const std::vector<uint32_t> outputIndexes = {1};
    139     std::vector<uint8_t> operandValues = {};
    140     const std::vector<hidl_memory> pools = {};
    141 
    142     return {
    143         .operands = operands,
    144         .operations = operations,
    145         .inputIndexes = inputIndexes,
    146         .outputIndexes = outputIndexes,
    147         .operandValues = operandValues,
    148         .pools = pools,
    149     };
    150 }
    151 
    152 inline bool is_ignored_float16(int i) {
    153   static std::set<int> ignore = {};
    154   return ignore.find(i) != ignore.end();
    155 }
    156 
    157 // Create the model
    158 Model createTestModel_int32() {
    159     const std::vector<Operand> operands = {
    160         {
    161             .type = OperandType::TENSOR_INT32,
    162             .dimensions = {1, 2, 3, 4, 5},
    163             .numberOfConsumers = 1,
    164             .scale = 0.0f,
    165             .zeroPoint = 0,
    166             .lifetime = OperandLifeTime::MODEL_INPUT,
    167             .location = {.poolIndex = 0, .offset = 0, .length = 0},
    168         },
    169         {
    170             .type = OperandType::TENSOR_INT32,
    171             .dimensions = {1, 2, 3, 4, 5},
    172             .numberOfConsumers = 0,
    173             .scale = 0.0f,
    174             .zeroPoint = 0,
    175             .lifetime = OperandLifeTime::MODEL_OUTPUT,
    176             .location = {.poolIndex = 0, .offset = 0, .length = 0},
    177         }
    178     };
    179 
    180     const std::vector<Operation> operations = {
    181         {
    182             .type = OperationType::NEG,
    183             .inputs = {0},
    184             .outputs = {1},
    185         }
    186     };
    187 
    188     const std::vector<uint32_t> inputIndexes = {0};
    189     const std::vector<uint32_t> outputIndexes = {1};
    190     std::vector<uint8_t> operandValues = {};
    191     const std::vector<hidl_memory> pools = {};
    192 
    193     return {
    194         .operands = operands,
    195         .operations = operations,
    196         .inputIndexes = inputIndexes,
    197         .outputIndexes = outputIndexes,
    198         .operandValues = operandValues,
    199         .pools = pools,
    200     };
    201 }
    202 
    203 inline bool is_ignored_int32(int i) {
    204   static std::set<int> ignore = {};
    205   return ignore.find(i) != ignore.end();
    206 }
    207 
    208 // Create the model
    209 Model createTestModel_dynamic_output_shape() {
    210     const std::vector<Operand> operands = {
    211         {
    212             .type = OperandType::TENSOR_FLOAT32,
    213             .dimensions = {1, 2, 3, 4, 5},
    214             .numberOfConsumers = 1,
    215             .scale = 0.0f,
    216             .zeroPoint = 0,
    217             .lifetime = OperandLifeTime::MODEL_INPUT,
    218             .location = {.poolIndex = 0, .offset = 0, .length = 0},
    219         },
    220         {
    221             .type = OperandType::TENSOR_FLOAT32,
    222             .dimensions = {0, 0, 0, 0, 0},
    223             .numberOfConsumers = 0,
    224             .scale = 0.0f,
    225             .zeroPoint = 0,
    226             .lifetime = OperandLifeTime::MODEL_OUTPUT,
    227             .location = {.poolIndex = 0, .offset = 0, .length = 0},
    228         }
    229     };
    230 
    231     const std::vector<Operation> operations = {
    232         {
    233             .type = OperationType::NEG,
    234             .inputs = {0},
    235             .outputs = {1},
    236         }
    237     };
    238 
    239     const std::vector<uint32_t> inputIndexes = {0};
    240     const std::vector<uint32_t> outputIndexes = {1};
    241     std::vector<uint8_t> operandValues = {};
    242     const std::vector<hidl_memory> pools = {};
    243 
    244     return {
    245         .operands = operands,
    246         .operations = operations,
    247         .inputIndexes = inputIndexes,
    248         .outputIndexes = outputIndexes,
    249         .operandValues = operandValues,
    250         .pools = pools,
    251     };
    252 }
    253 
    254 inline bool is_ignored_dynamic_output_shape(int i) {
    255   static std::set<int> ignore = {};
    256   return ignore.find(i) != ignore.end();
    257 }
    258 
    259 // Create the model
    260 Model createTestModel_dynamic_output_shape_relaxed() {
    261     const std::vector<Operand> operands = {
    262         {
    263             .type = OperandType::TENSOR_FLOAT32,
    264             .dimensions = {1, 2, 3, 4, 5},
    265             .numberOfConsumers = 1,
    266             .scale = 0.0f,
    267             .zeroPoint = 0,
    268             .lifetime = OperandLifeTime::MODEL_INPUT,
    269             .location = {.poolIndex = 0, .offset = 0, .length = 0},
    270         },
    271         {
    272             .type = OperandType::TENSOR_FLOAT32,
    273             .dimensions = {0, 0, 0, 0, 0},
    274             .numberOfConsumers = 0,
    275             .scale = 0.0f,
    276             .zeroPoint = 0,
    277             .lifetime = OperandLifeTime::MODEL_OUTPUT,
    278             .location = {.poolIndex = 0, .offset = 0, .length = 0},
    279         }
    280     };
    281 
    282     const std::vector<Operation> operations = {
    283         {
    284             .type = OperationType::NEG,
    285             .inputs = {0},
    286             .outputs = {1},
    287         }
    288     };
    289 
    290     const std::vector<uint32_t> inputIndexes = {0};
    291     const std::vector<uint32_t> outputIndexes = {1};
    292     std::vector<uint8_t> operandValues = {};
    293     const std::vector<hidl_memory> pools = {};
    294 
    295     return {
    296         .operands = operands,
    297         .operations = operations,
    298         .inputIndexes = inputIndexes,
    299         .outputIndexes = outputIndexes,
    300         .operandValues = operandValues,
    301         .pools = pools,
    302         .relaxComputationFloat32toFloat16 = true,
    303     };
    304 }
    305 
    306 inline bool is_ignored_dynamic_output_shape_relaxed(int i) {
    307   static std::set<int> ignore = {};
    308   return ignore.find(i) != ignore.end();
    309 }
    310 
    311 // Create the model
    312 Model createTestModel_dynamic_output_shape_float16() {
    313     const std::vector<Operand> operands = {
    314         {
    315             .type = OperandType::TENSOR_FLOAT16,
    316             .dimensions = {1, 2, 3, 4, 5},
    317             .numberOfConsumers = 1,
    318             .scale = 0.0f,
    319             .zeroPoint = 0,
    320             .lifetime = OperandLifeTime::MODEL_INPUT,
    321             .location = {.poolIndex = 0, .offset = 0, .length = 0},
    322         },
    323         {
    324             .type = OperandType::TENSOR_FLOAT16,
    325             .dimensions = {0, 0, 0, 0, 0},
    326             .numberOfConsumers = 0,
    327             .scale = 0.0f,
    328             .zeroPoint = 0,
    329             .lifetime = OperandLifeTime::MODEL_OUTPUT,
    330             .location = {.poolIndex = 0, .offset = 0, .length = 0},
    331         }
    332     };
    333 
    334     const std::vector<Operation> operations = {
    335         {
    336             .type = OperationType::NEG,
    337             .inputs = {0},
    338             .outputs = {1},
    339         }
    340     };
    341 
    342     const std::vector<uint32_t> inputIndexes = {0};
    343     const std::vector<uint32_t> outputIndexes = {1};
    344     std::vector<uint8_t> operandValues = {};
    345     const std::vector<hidl_memory> pools = {};
    346 
    347     return {
    348         .operands = operands,
    349         .operations = operations,
    350         .inputIndexes = inputIndexes,
    351         .outputIndexes = outputIndexes,
    352         .operandValues = operandValues,
    353         .pools = pools,
    354     };
    355 }
    356 
    357 inline bool is_ignored_dynamic_output_shape_float16(int i) {
    358   static std::set<int> ignore = {};
    359   return ignore.find(i) != ignore.end();
    360 }
    361 
    362 // Create the model
    363 Model createTestModel_dynamic_output_shape_int32() {
    364     const std::vector<Operand> operands = {
    365         {
    366             .type = OperandType::TENSOR_INT32,
    367             .dimensions = {1, 2, 3, 4, 5},
    368             .numberOfConsumers = 1,
    369             .scale = 0.0f,
    370             .zeroPoint = 0,
    371             .lifetime = OperandLifeTime::MODEL_INPUT,
    372             .location = {.poolIndex = 0, .offset = 0, .length = 0},
    373         },
    374         {
    375             .type = OperandType::TENSOR_INT32,
    376             .dimensions = {0, 0, 0, 0, 0},
    377             .numberOfConsumers = 0,
    378             .scale = 0.0f,
    379             .zeroPoint = 0,
    380             .lifetime = OperandLifeTime::MODEL_OUTPUT,
    381             .location = {.poolIndex = 0, .offset = 0, .length = 0},
    382         }
    383     };
    384 
    385     const std::vector<Operation> operations = {
    386         {
    387             .type = OperationType::NEG,
    388             .inputs = {0},
    389             .outputs = {1},
    390         }
    391     };
    392 
    393     const std::vector<uint32_t> inputIndexes = {0};
    394     const std::vector<uint32_t> outputIndexes = {1};
    395     std::vector<uint8_t> operandValues = {};
    396     const std::vector<hidl_memory> pools = {};
    397 
    398     return {
    399         .operands = operands,
    400         .operations = operations,
    401         .inputIndexes = inputIndexes,
    402         .outputIndexes = outputIndexes,
    403         .operandValues = operandValues,
    404         .pools = pools,
    405     };
    406 }
    407 
    408 inline bool is_ignored_dynamic_output_shape_int32(int i) {
    409   static std::set<int> ignore = {};
    410   return ignore.find(i) != ignore.end();
    411 }
    412 
    413