Skip to content

Commit

Permalink
Remove unused function from faiss/utils/quantize_lut.cpp
Browse files Browse the repository at this point in the history
Summary: `-Wunused-function` has identified an unused function. This diff removes it. In many cases these functions have existed for years in an unused state.

Reviewed By: bunnypak

Differential Revision: D52355736

fbshipit-source-id: e315cf420053472218bbf2fdd647ab073c6f6cd6
  • Loading branch information
r-barnes authored and facebook-github-bot committed Dec 21, 2023
1 parent 5621487 commit 65b08ef
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions faiss/utils/quantize_lut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,6 @@ namespace quantize_lut {

namespace {

float round_uint8_and_mul(float* tab, size_t n) {
float max = 0;
for (int i = 0; i < n; i++) {
if (fabs(tab[i]) > max) {
max = fabs(tab[i]);
}
}
float multiplier = 127 / max;
for (int i = 0; i < n; i++) {
tab[i] = floorf(tab[i] * multiplier + 128);
}
return multiplier;
}

// there can be NaNs in tables, they should be ignored
float tab_min(const float* tab, size_t n) {
float min = HUGE_VAL;
Expand Down

0 comments on commit 65b08ef

Please sign in to comment.