| 156 | } |
| 157 | |
| 158 | void DenseLshProjection(const TfLiteTensor* hash, const TfLiteTensor* input, |
| 159 | const TfLiteTensor* weight, int32_t* out_buf) { |
| 160 | int num_hash = SizeOfDimension(hash, 0); |
| 161 | int num_bits = SizeOfDimension(hash, 1); |
| 162 | for (int i = 0; i < num_hash; i++) { |
| 163 | for (int j = 0; j < num_bits; j++) { |
| 164 | float seed = hash->data.f[i * num_bits + j]; |
| 165 | int bit = RunningSignBit(input, weight, seed); |
| 166 | *out_buf++ = bit; |
| 167 | } |
| 168 | } |
| 169 | } |
| 170 | |
| 171 | TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { |
| 172 | auto* params = |
no test coverage detected