• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // clang-format off
2 // Generated file (from: div_relaxed.mod.py). Do not edit
3 // Create the model
createTestModel()4 Model createTestModel() {
5     const std::vector<Operand> operands = {
6         {
7             .type = OperandType::TENSOR_FLOAT32,
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_FLOAT32,
17             .dimensions = {1, 2, 2, 1},
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::INT32,
26             .dimensions = {},
27             .numberOfConsumers = 1,
28             .scale = 0.0f,
29             .zeroPoint = 0,
30             .lifetime = OperandLifeTime::CONSTANT_COPY,
31             .location = {.poolIndex = 0, .offset = 0, .length = 4},
32         },
33         {
34             .type = OperandType::TENSOR_FLOAT32,
35             .dimensions = {1, 2, 2, 1},
36             .numberOfConsumers = 0,
37             .scale = 0.0f,
38             .zeroPoint = 0,
39             .lifetime = OperandLifeTime::MODEL_OUTPUT,
40             .location = {.poolIndex = 0, .offset = 0, .length = 0},
41         }
42     };
43 
44     const std::vector<Operation> operations = {
45         {
46             .type = OperationType::DIV,
47             .inputs = {0, 1, 2},
48             .outputs = {3},
49         }
50     };
51 
52     const std::vector<uint32_t> inputIndexes = {0, 1};
53     const std::vector<uint32_t> outputIndexes = {3};
54     std::vector<uint8_t> operandValues = {
55       0, 0, 0, 0
56     };
57     const std::vector<hidl_memory> pools = {};
58 
59     return {
60         .operands = operands,
61         .operations = operations,
62         .inputIndexes = inputIndexes,
63         .outputIndexes = outputIndexes,
64         .operandValues = operandValues,
65         .pools = pools,
66         .relaxComputationFloat32toFloat16 = true,
67     };
68 }
69 
is_ignored(int i)70 inline bool is_ignored(int i) {
71   static std::set<int> ignore = {};
72   return ignore.find(i) != ignore.end();
73 }
74 
75 // Create the model
createTestModel_dynamic_output_shape()76 Model createTestModel_dynamic_output_shape() {
77     const std::vector<Operand> operands = {
78         {
79             .type = OperandType::TENSOR_FLOAT32,
80             .dimensions = {1, 2, 2, 1},
81             .numberOfConsumers = 1,
82             .scale = 0.0f,
83             .zeroPoint = 0,
84             .lifetime = OperandLifeTime::MODEL_INPUT,
85             .location = {.poolIndex = 0, .offset = 0, .length = 0},
86         },
87         {
88             .type = OperandType::TENSOR_FLOAT32,
89             .dimensions = {1, 2, 2, 1},
90             .numberOfConsumers = 1,
91             .scale = 0.0f,
92             .zeroPoint = 0,
93             .lifetime = OperandLifeTime::MODEL_INPUT,
94             .location = {.poolIndex = 0, .offset = 0, .length = 0},
95         },
96         {
97             .type = OperandType::INT32,
98             .dimensions = {},
99             .numberOfConsumers = 1,
100             .scale = 0.0f,
101             .zeroPoint = 0,
102             .lifetime = OperandLifeTime::CONSTANT_COPY,
103             .location = {.poolIndex = 0, .offset = 0, .length = 4},
104         },
105         {
106             .type = OperandType::TENSOR_FLOAT32,
107             .dimensions = {0, 0, 0, 0},
108             .numberOfConsumers = 0,
109             .scale = 0.0f,
110             .zeroPoint = 0,
111             .lifetime = OperandLifeTime::MODEL_OUTPUT,
112             .location = {.poolIndex = 0, .offset = 0, .length = 0},
113         }
114     };
115 
116     const std::vector<Operation> operations = {
117         {
118             .type = OperationType::DIV,
119             .inputs = {0, 1, 2},
120             .outputs = {3},
121         }
122     };
123 
124     const std::vector<uint32_t> inputIndexes = {0, 1};
125     const std::vector<uint32_t> outputIndexes = {3};
126     std::vector<uint8_t> operandValues = {
127       0, 0, 0, 0
128     };
129     const std::vector<hidl_memory> pools = {};
130 
131     return {
132         .operands = operands,
133         .operations = operations,
134         .inputIndexes = inputIndexes,
135         .outputIndexes = outputIndexes,
136         .operandValues = operandValues,
137         .pools = pools,
138         .relaxComputationFloat32toFloat16 = true,
139     };
140 }
141 
is_ignored_dynamic_output_shape(int i)142 inline bool is_ignored_dynamic_output_shape(int i) {
143   static std::set<int> ignore = {};
144   return ignore.find(i) != ignore.end();
145 }
146 
147