• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // clang-format off
2 // Generated file (from: lsh_projection.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 = {4, 2},
9             .numberOfConsumers = 1,
10             .scale = 0.0f,
11             .zeroPoint = 0,
12             .lifetime = OperandLifeTime::CONSTANT_COPY,
13             .location = {.poolIndex = 0, .offset = 0, .length = 32},
14         },
15         {
16             .type = OperandType::TENSOR_INT32,
17             .dimensions = {3, 2},
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},
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::INT32,
35             .dimensions = {},
36             .numberOfConsumers = 1,
37             .scale = 0.0f,
38             .zeroPoint = 0,
39             .lifetime = OperandLifeTime::CONSTANT_COPY,
40             .location = {.poolIndex = 0, .offset = 32, .length = 4},
41         },
42         {
43             .type = OperandType::TENSOR_INT32,
44             .dimensions = {8},
45             .numberOfConsumers = 0,
46             .scale = 0.0f,
47             .zeroPoint = 0,
48             .lifetime = OperandLifeTime::MODEL_OUTPUT,
49             .location = {.poolIndex = 0, .offset = 0, .length = 0},
50         }
51     };
52 
53     const std::vector<Operation> operations = {
54         {
55             .type = OperationType::LSH_PROJECTION,
56             .inputs = {0, 1, 2, 3},
57             .outputs = {4},
58         }
59     };
60 
61     const std::vector<uint32_t> inputIndexes = {1, 2};
62     const std::vector<uint32_t> outputIndexes = {4};
63     std::vector<uint8_t> operandValues = {
64       109, 231, 251, 61, 213, 120, 233, 62, 29, 90, 164, 190, 139, 108, 39, 191, 182, 243, 157, 63, 45, 178, 181, 64, 162, 69, 138, 192, 113, 61, 12, 193, 2, 0, 0, 0
65     };
66     const std::vector<hidl_memory> pools = {};
67 
68     return {
69         .operands = operands,
70         .operations = operations,
71         .inputIndexes = inputIndexes,
72         .outputIndexes = outputIndexes,
73         .operandValues = operandValues,
74         .pools = pools,
75     };
76 }
77 
is_ignored(int i)78 inline bool is_ignored(int i) {
79   static std::set<int> ignore = {};
80   return ignore.find(i) != ignore.end();
81 }
82 
83 // Create the model
createTestModel_dynamic_output_shape()84 Model createTestModel_dynamic_output_shape() {
85     const std::vector<Operand> operands = {
86         {
87             .type = OperandType::TENSOR_FLOAT32,
88             .dimensions = {4, 2},
89             .numberOfConsumers = 1,
90             .scale = 0.0f,
91             .zeroPoint = 0,
92             .lifetime = OperandLifeTime::CONSTANT_COPY,
93             .location = {.poolIndex = 0, .offset = 0, .length = 32},
94         },
95         {
96             .type = OperandType::TENSOR_INT32,
97             .dimensions = {3, 2},
98             .numberOfConsumers = 1,
99             .scale = 0.0f,
100             .zeroPoint = 0,
101             .lifetime = OperandLifeTime::MODEL_INPUT,
102             .location = {.poolIndex = 0, .offset = 0, .length = 0},
103         },
104         {
105             .type = OperandType::TENSOR_FLOAT32,
106             .dimensions = {3},
107             .numberOfConsumers = 1,
108             .scale = 0.0f,
109             .zeroPoint = 0,
110             .lifetime = OperandLifeTime::MODEL_INPUT,
111             .location = {.poolIndex = 0, .offset = 0, .length = 0},
112         },
113         {
114             .type = OperandType::INT32,
115             .dimensions = {},
116             .numberOfConsumers = 1,
117             .scale = 0.0f,
118             .zeroPoint = 0,
119             .lifetime = OperandLifeTime::CONSTANT_COPY,
120             .location = {.poolIndex = 0, .offset = 32, .length = 4},
121         },
122         {
123             .type = OperandType::TENSOR_INT32,
124             .dimensions = {0},
125             .numberOfConsumers = 0,
126             .scale = 0.0f,
127             .zeroPoint = 0,
128             .lifetime = OperandLifeTime::MODEL_OUTPUT,
129             .location = {.poolIndex = 0, .offset = 0, .length = 0},
130         }
131     };
132 
133     const std::vector<Operation> operations = {
134         {
135             .type = OperationType::LSH_PROJECTION,
136             .inputs = {0, 1, 2, 3},
137             .outputs = {4},
138         }
139     };
140 
141     const std::vector<uint32_t> inputIndexes = {1, 2};
142     const std::vector<uint32_t> outputIndexes = {4};
143     std::vector<uint8_t> operandValues = {
144       109, 231, 251, 61, 213, 120, 233, 62, 29, 90, 164, 190, 139, 108, 39, 191, 182, 243, 157, 63, 45, 178, 181, 64, 162, 69, 138, 192, 113, 61, 12, 193, 2, 0, 0, 0
145     };
146     const std::vector<hidl_memory> pools = {};
147 
148     return {
149         .operands = operands,
150         .operations = operations,
151         .inputIndexes = inputIndexes,
152         .outputIndexes = outputIndexes,
153         .operandValues = operandValues,
154         .pools = pools,
155     };
156 }
157 
is_ignored_dynamic_output_shape(int i)158 inline bool is_ignored_dynamic_output_shape(int i) {
159   static std::set<int> ignore = {};
160   return ignore.find(i) != ignore.end();
161 }
162 
163