Home | History | Annotate | Download | only in vts_models
      1 // clang-format off
      2 // Generated file (from: rnn_float16.mod.py). Do not edit
      3 // Create the model
      4 Model createTestModel() {
      5     const std::vector<Operand> operands = {
      6         {
      7             .type = OperandType::TENSOR_FLOAT16,
      8             .dimensions = {2, 8},
      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_FLOAT16,
     17             .dimensions = {16, 8},
     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_FLOAT16,
     26             .dimensions = {16, 16},
     27             .numberOfConsumers = 1,
     28             .scale = 0.0f,
     29             .zeroPoint = 0,
     30             .lifetime = OperandLifeTime::MODEL_INPUT,
     31             .location = {.poolIndex = 0, .offset = 0, .length = 0},
     32         },
     33         {
     34             .type = OperandType::TENSOR_FLOAT16,
     35             .dimensions = {16},
     36             .numberOfConsumers = 1,
     37             .scale = 0.0f,
     38             .zeroPoint = 0,
     39             .lifetime = OperandLifeTime::MODEL_INPUT,
     40             .location = {.poolIndex = 0, .offset = 0, .length = 0},
     41         },
     42         {
     43             .type = OperandType::TENSOR_FLOAT16,
     44             .dimensions = {2, 16},
     45             .numberOfConsumers = 1,
     46             .scale = 0.0f,
     47             .zeroPoint = 0,
     48             .lifetime = OperandLifeTime::MODEL_INPUT,
     49             .location = {.poolIndex = 0, .offset = 0, .length = 0},
     50         },
     51         {
     52             .type = OperandType::INT32,
     53             .dimensions = {},
     54             .numberOfConsumers = 1,
     55             .scale = 0.0f,
     56             .zeroPoint = 0,
     57             .lifetime = OperandLifeTime::CONSTANT_COPY,
     58             .location = {.poolIndex = 0, .offset = 0, .length = 4},
     59         },
     60         {
     61             .type = OperandType::TENSOR_FLOAT16,
     62             .dimensions = {2, 16},
     63             .numberOfConsumers = 0,
     64             .scale = 0.0f,
     65             .zeroPoint = 0,
     66             .lifetime = OperandLifeTime::MODEL_OUTPUT,
     67             .location = {.poolIndex = 0, .offset = 0, .length = 0},
     68         },
     69         {
     70             .type = OperandType::TENSOR_FLOAT16,
     71             .dimensions = {2, 16},
     72             .numberOfConsumers = 0,
     73             .scale = 0.0f,
     74             .zeroPoint = 0,
     75             .lifetime = OperandLifeTime::MODEL_OUTPUT,
     76             .location = {.poolIndex = 0, .offset = 0, .length = 0},
     77         }
     78     };
     79 
     80     const std::vector<Operation> operations = {
     81         {
     82             .type = OperationType::RNN,
     83             .inputs = {0, 1, 2, 3, 4, 5},
     84             .outputs = {6, 7},
     85         }
     86     };
     87 
     88     const std::vector<uint32_t> inputIndexes = {0, 1, 2, 3, 4};
     89     const std::vector<uint32_t> outputIndexes = {6, 7};
     90     std::vector<uint8_t> operandValues = {
     91       1, 0, 0, 0
     92     };
     93     const std::vector<hidl_memory> pools = {};
     94 
     95     return {
     96         .operands = operands,
     97         .operations = operations,
     98         .inputIndexes = inputIndexes,
     99         .outputIndexes = outputIndexes,
    100         .operandValues = operandValues,
    101         .pools = pools,
    102     };
    103 }
    104 
    105 inline bool is_ignored(int i) {
    106   static std::set<int> ignore = {0};
    107   return ignore.find(i) != ignore.end();
    108 }
    109 
    110 // Create the model
    111 Model createTestModel_dynamic_output_shape() {
    112     const std::vector<Operand> operands = {
    113         {
    114             .type = OperandType::TENSOR_FLOAT16,
    115             .dimensions = {2, 8},
    116             .numberOfConsumers = 1,
    117             .scale = 0.0f,
    118             .zeroPoint = 0,
    119             .lifetime = OperandLifeTime::MODEL_INPUT,
    120             .location = {.poolIndex = 0, .offset = 0, .length = 0},
    121         },
    122         {
    123             .type = OperandType::TENSOR_FLOAT16,
    124             .dimensions = {16, 8},
    125             .numberOfConsumers = 1,
    126             .scale = 0.0f,
    127             .zeroPoint = 0,
    128             .lifetime = OperandLifeTime::MODEL_INPUT,
    129             .location = {.poolIndex = 0, .offset = 0, .length = 0},
    130         },
    131         {
    132             .type = OperandType::TENSOR_FLOAT16,
    133             .dimensions = {16, 16},
    134             .numberOfConsumers = 1,
    135             .scale = 0.0f,
    136             .zeroPoint = 0,
    137             .lifetime = OperandLifeTime::MODEL_INPUT,
    138             .location = {.poolIndex = 0, .offset = 0, .length = 0},
    139         },
    140         {
    141             .type = OperandType::TENSOR_FLOAT16,
    142             .dimensions = {16},
    143             .numberOfConsumers = 1,
    144             .scale = 0.0f,
    145             .zeroPoint = 0,
    146             .lifetime = OperandLifeTime::MODEL_INPUT,
    147             .location = {.poolIndex = 0, .offset = 0, .length = 0},
    148         },
    149         {
    150             .type = OperandType::TENSOR_FLOAT16,
    151             .dimensions = {2, 16},
    152             .numberOfConsumers = 1,
    153             .scale = 0.0f,
    154             .zeroPoint = 0,
    155             .lifetime = OperandLifeTime::MODEL_INPUT,
    156             .location = {.poolIndex = 0, .offset = 0, .length = 0},
    157         },
    158         {
    159             .type = OperandType::INT32,
    160             .dimensions = {},
    161             .numberOfConsumers = 1,
    162             .scale = 0.0f,
    163             .zeroPoint = 0,
    164             .lifetime = OperandLifeTime::CONSTANT_COPY,
    165             .location = {.poolIndex = 0, .offset = 0, .length = 4},
    166         },
    167         {
    168             .type = OperandType::TENSOR_FLOAT16,
    169             .dimensions = {0, 0},
    170             .numberOfConsumers = 0,
    171             .scale = 0.0f,
    172             .zeroPoint = 0,
    173             .lifetime = OperandLifeTime::MODEL_OUTPUT,
    174             .location = {.poolIndex = 0, .offset = 0, .length = 0},
    175         },
    176         {
    177             .type = OperandType::TENSOR_FLOAT16,
    178             .dimensions = {0, 0},
    179             .numberOfConsumers = 0,
    180             .scale = 0.0f,
    181             .zeroPoint = 0,
    182             .lifetime = OperandLifeTime::MODEL_OUTPUT,
    183             .location = {.poolIndex = 0, .offset = 0, .length = 0},
    184         }
    185     };
    186 
    187     const std::vector<Operation> operations = {
    188         {
    189             .type = OperationType::RNN,
    190             .inputs = {0, 1, 2, 3, 4, 5},
    191             .outputs = {6, 7},
    192         }
    193     };
    194 
    195     const std::vector<uint32_t> inputIndexes = {0, 1, 2, 3, 4};
    196     const std::vector<uint32_t> outputIndexes = {6, 7};
    197     std::vector<uint8_t> operandValues = {
    198       1, 0, 0, 0
    199     };
    200     const std::vector<hidl_memory> pools = {};
    201 
    202     return {
    203         .operands = operands,
    204         .operations = operations,
    205         .inputIndexes = inputIndexes,
    206         .outputIndexes = outputIndexes,
    207         .operandValues = operandValues,
    208         .pools = pools,
    209     };
    210 }
    211 
    212 inline bool is_ignored_dynamic_output_shape(int i) {
    213   static std::set<int> ignore = {0};
    214   return ignore.find(i) != ignore.end();
    215 }
    216 
    217