MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / DenseLshProjection

Function DenseLshProjection

tensorflow/lite/kernels/lsh_projection.cc:158–169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

156}
157
158void 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
171TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
172 auto* params =

Callers 1

EvalFunction · 0.85

Calls 2

SizeOfDimensionFunction · 0.85
RunningSignBitFunction · 0.85

Tested by

no test coverage detected