1 // clang-format off
2 // Generated file (from: embedding_lookup.mod.py). Do not edit
3 // Create the model
createTestModel()4 Model createTestModel() {
5 const std::vector<Operand> operands = {
6 {
7 .type = OperandType::TENSOR_INT32,
8 .dimensions = {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_FLOAT32,
17 .dimensions = {3, 2, 4},
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 = {3, 2, 4},
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::EMBEDDING_LOOKUP,
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
is_ignored(int i)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
createTestModel_dynamic_output_shape()64 Model createTestModel_dynamic_output_shape() {
65 const std::vector<Operand> operands = {
66 {
67 .type = OperandType::TENSOR_INT32,
68 .dimensions = {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_FLOAT32,
77 .dimensions = {3, 2, 4},
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 = {0, 0, 0},
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::EMBEDDING_LOOKUP,
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 };
116 }
117
is_ignored_dynamic_output_shape(int i)118 inline bool is_ignored_dynamic_output_shape(int i) {
119 static std::set<int> ignore = {};
120 return ignore.find(i) != ignore.end();
121 }
122
123