| 169 | } |
| 170 | |
| 171 | TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { |
| 172 | auto* params = |
| 173 | reinterpret_cast<TfLiteLSHProjectionParams*>(node->builtin_data); |
| 174 | |
| 175 | int32_t* out_buf = GetOutput(context, node, 0)->data.i32; |
| 176 | const TfLiteTensor* hash = GetInput(context, node, 0); |
| 177 | const TfLiteTensor* input = GetInput(context, node, 1); |
| 178 | const TfLiteTensor* weight = |
| 179 | NumInputs(node) == 2 ? nullptr : GetInput(context, node, 2); |
| 180 | |
| 181 | switch (params->type) { |
| 182 | case kTfLiteLshProjectionDense: |
| 183 | DenseLshProjection(hash, input, weight, out_buf); |
| 184 | break; |
| 185 | case kTfLiteLshProjectionSparse: |
| 186 | SparseLshProjection(hash, input, weight, out_buf); |
| 187 | break; |
| 188 | default: |
| 189 | return kTfLiteError; |
| 190 | } |
| 191 | |
| 192 | return kTfLiteOk; |
| 193 | } |
| 194 | } // namespace lsh_projection |
| 195 | |
| 196 | TfLiteRegistration* Register_LSH_PROJECTION() { |
nothing calls this directly
no test coverage detected