1 // clang-format off
2 // Generated file (from: pad_float16.mod.py). Do not edit
3 // Create the model
createTestModel()4 Model createTestModel() {
5 const std::vector<Operand> operands = {
6 {
7 .type = OperandType::TENSOR_FLOAT16,
8 .dimensions = {1, 2, 2, 1},
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 = {4, 2},
18 .numberOfConsumers = 1,
19 .scale = 0.0f,
20 .zeroPoint = 0,
21 .lifetime = OperandLifeTime::CONSTANT_COPY,
22 .location = {.poolIndex = 0, .offset = 0, .length = 32},
23 },
24 {
25 .type = OperandType::TENSOR_FLOAT16,
26 .dimensions = {1, 4, 4, 1},
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::PAD,
38 .inputs = {0, 1},
39 .outputs = {2},
40 }
41 };
42
43 const std::vector<uint32_t> inputIndexes = {0};
44 const std::vector<uint32_t> outputIndexes = {2};
45 std::vector<uint8_t> operandValues = {
46 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
47 };
48 const std::vector<hidl_memory> pools = {};
49
50 return {
51 .operands = operands,
52 .operations = operations,
53 .inputIndexes = inputIndexes,
54 .outputIndexes = outputIndexes,
55 .operandValues = operandValues,
56 .pools = pools,
57 };
58 }
59
is_ignored(int i)60 inline bool is_ignored(int i) {
61 static std::set<int> ignore = {};
62 return ignore.find(i) != ignore.end();
63 }
64
65 // Create the model
createTestModel_dynamic_output_shape()66 Model createTestModel_dynamic_output_shape() {
67 const std::vector<Operand> operands = {
68 {
69 .type = OperandType::TENSOR_FLOAT16,
70 .dimensions = {1, 2, 2, 1},
71 .numberOfConsumers = 1,
72 .scale = 0.0f,
73 .zeroPoint = 0,
74 .lifetime = OperandLifeTime::MODEL_INPUT,
75 .location = {.poolIndex = 0, .offset = 0, .length = 0},
76 },
77 {
78 .type = OperandType::TENSOR_INT32,
79 .dimensions = {4, 2},
80 .numberOfConsumers = 1,
81 .scale = 0.0f,
82 .zeroPoint = 0,
83 .lifetime = OperandLifeTime::CONSTANT_COPY,
84 .location = {.poolIndex = 0, .offset = 0, .length = 32},
85 },
86 {
87 .type = OperandType::TENSOR_FLOAT16,
88 .dimensions = {0, 0, 0, 0},
89 .numberOfConsumers = 0,
90 .scale = 0.0f,
91 .zeroPoint = 0,
92 .lifetime = OperandLifeTime::MODEL_OUTPUT,
93 .location = {.poolIndex = 0, .offset = 0, .length = 0},
94 }
95 };
96
97 const std::vector<Operation> operations = {
98 {
99 .type = OperationType::PAD,
100 .inputs = {0, 1},
101 .outputs = {2},
102 }
103 };
104
105 const std::vector<uint32_t> inputIndexes = {0};
106 const std::vector<uint32_t> outputIndexes = {2};
107 std::vector<uint8_t> operandValues = {
108 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
109 };
110 const std::vector<hidl_memory> pools = {};
111
112 return {
113 .operands = operands,
114 .operations = operations,
115 .inputIndexes = inputIndexes,
116 .outputIndexes = outputIndexes,
117 .operandValues = operandValues,
118 .pools = pools,
119 };
120 }
121
is_ignored_dynamic_output_shape(int i)122 inline bool is_ignored_dynamic_output_shape(int i) {
123 static std::set<int> ignore = {};
124 return ignore.find(i) != ignore.end();
125 }
126
127