Skip to content

Commit a465d1b

Browse files
Michael Norrisfacebook-github-bot
authored andcommitted
more telemetry classes (#3854)
Summary: Pull Request resolved: #3854 We need some more functions exposed for use in telemetry wrapper classes. This PR changes some functions in read_index to be non static and exposes them in the header. (Laser can also write IndexIVFPQ and IndexIVFScalarQuantizer, so those are added). Differential Revision: D62623242
1 parent dc55e11 commit a465d1b

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

faiss/impl/index_read.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ void read_InvertedLists(IndexIVF* ivf, IOReader* f, int io_flags) {
243243
ivf->own_invlists = true;
244244
}
245245

246-
static void read_ProductQuantizer(ProductQuantizer* pq, IOReader* f) {
246+
void read_ProductQuantizer(ProductQuantizer* pq, IOReader* f) {
247247
READ1(pq->d);
248248
READ1(pq->M);
249249
READ1(pq->nbits);
@@ -353,7 +353,7 @@ static void read_ProductLocalSearchQuantizer(
353353
}
354354
}
355355

356-
static void read_ScalarQuantizer(ScalarQuantizer* ivsc, IOReader* f) {
356+
void read_ScalarQuantizer(ScalarQuantizer* ivsc, IOReader* f) {
357357
READ1(ivsc->qtype);
358358
READ1(ivsc->rangestat);
359359
READ1(ivsc->rangestat_arg);
@@ -476,7 +476,7 @@ void read_ivf_header(
476476
}
477477

478478
// used for legacy formats
479-
static ArrayInvertedLists* set_array_invlist(
479+
ArrayInvertedLists* set_array_invlist(
480480
IndexIVF* ivf,
481481
std::vector<std::vector<idx_t>>& ids) {
482482
ArrayInvertedLists* ail =

faiss/impl/index_read_utils.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
#pragma once
1717

1818
namespace faiss {
19+
struct ProductQuantizer;
20+
struct ScalarQuantizer;
1921

2022
void read_index_header(Index* idx, IOReader* f);
2123
void read_direct_map(DirectMap* dm, IOReader* f);
@@ -24,6 +26,11 @@ void read_ivf_header(
2426
IOReader* f,
2527
std::vector<std::vector<idx_t>>* ids = nullptr);
2628
void read_InvertedLists(IndexIVF* ivf, IOReader* f, int io_flags);
29+
ArrayInvertedLists* set_array_invlist(
30+
IndexIVF* ivf,
31+
std::vector<std::vector<idx_t>>& ids);
32+
void read_ProductQuantizer(ProductQuantizer* pq, IOReader* f);
33+
void read_ScalarQuantizer(ScalarQuantizer* ivsc, IOReader* f);
2734

2835
} // namespace faiss
2936

0 commit comments

Comments
 (0)