Skip to content

Commit 8a9e600

Browse files
Harry-Chenfacebook-github-bot
authored andcommitted
Fix several typos in code detected by lintian (#3861)
Summary: All typos are not names of public APIs, thus safe to fix. Closes #3859 Pull Request resolved: #3861 Reviewed By: asadoughi Differential Revision: D62717144 Pulled By: junjieqi fbshipit-source-id: 647de83ac5d6dba713031c2fc8af7b3f4d84f1d3
1 parent dc55e11 commit 8a9e600

15 files changed

+28
-28
lines changed

faiss/AutoTune.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ struct OperatingPoint {
8686
double perf; ///< performance measure (output of a Criterion)
8787
double t; ///< corresponding execution time (ms)
8888
std::string key; ///< key that identifies this op pt
89-
int64_t cno; ///< integer identifer
89+
int64_t cno; ///< integer identifier
9090
};
9191

9292
struct OperatingPoints {

faiss/IndexBinaryHNSW.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace faiss {
2121
struct IndexBinaryHNSW : IndexBinary {
2222
typedef HNSW::storage_idx_t storage_idx_t;
2323

24-
// the link strcuture
24+
// the link structure
2525
HNSW hnsw;
2626

2727
// the sequential storage

faiss/IndexIVF.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ struct InvertedListScanner {
479479
virtual float distance_to_code(const uint8_t* code) const = 0;
480480

481481
/** scan a set of codes, compute distances to current query and
482-
* update heap of results if necessary. Default implemetation
482+
* update heap of results if necessary. Default implementation
483483
* calls distance_to_code.
484484
*
485485
* @param n number of codes to scan

faiss/IndexIVFFastScan.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ void IndexIVFFastScan::range_search_dispatch_implem(
694694
search_implem_10(
695695
n, x, *handler.get(), cq, &ndis, &nlist_visited, scaler);
696696
} else {
697-
FAISS_THROW_FMT("Range search implem %d not impemented", impl);
697+
FAISS_THROW_FMT("Range search implem %d not implemented", impl);
698698
}
699699
} else {
700700
// explicitly slice over threads

faiss/IndexNNDescent.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ struct IndexNNDescent : Index {
2626

2727
/// Faiss results are 64-bit
2828

29-
// the link strcuture
29+
// the link structure
3030
NNDescent nndescent;
3131

3232
// the sequential storage

faiss/IndexNSG.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace faiss {
2424
* link structure built on top */
2525

2626
struct IndexNSG : Index {
27-
/// the link strcuture
27+
/// the link structure
2828
NSG nsg;
2929

3030
/// the sequential storage

faiss/IndexPreTransform.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ struct SearchParametersPreTransform : SearchParameters {
2323
/** Index that applies a LinearTransform transform on vectors before
2424
* handing them over to a sub-index */
2525
struct IndexPreTransform : Index {
26-
std::vector<VectorTransform*> chain; ///! chain of tranforms
26+
std::vector<VectorTransform*> chain; ///! chain of transforms
2727
Index* index; ///! the sub-index
2828

2929
bool own_fields; ///! whether pointers are deleted in destructor

faiss/impl/AuxIndexStructures.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ struct RangeSearchPartialResult : BufferList {
122122
void copy_result(bool incremental = false);
123123

124124
/// merge a set of PartialResult's into one RangeSearchResult
125-
/// on ouptut the partialresults are empty!
125+
/// on output the partialresults are empty!
126126
static void merge(
127127
std::vector<RangeSearchPartialResult*>& partial_results,
128128
bool do_delete = true);

faiss/impl/pq4_fast_scan_search_1.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ void pq4_accumulate_loop(
217217
SIMDResultHandler& res,
218218
const NormTableScaler* scaler) {
219219
Run_pq4_accumulate_loop consumer;
220-
dispatch_SIMDResultHanlder(
220+
dispatch_SIMDResultHandler(
221221
res, consumer, nq, nb, bbs, nsq, codes, LUT, scaler);
222222
}
223223

faiss/impl/pq4_fast_scan_search_qbs.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ void pq4_accumulate_loop_qbs(
751751
SIMDResultHandler& res,
752752
const NormTableScaler* scaler) {
753753
Run_pq4_accumulate_loop_qbs consumer;
754-
dispatch_SIMDResultHanlder(res, consumer, qbs, nb, nsq, codes, LUT, scaler);
754+
dispatch_SIMDResultHandler(res, consumer, qbs, nb, nsq, codes, LUT, scaler);
755755
}
756756

757757
/***************************************************************

faiss/impl/residual_quantizer_encode_steps.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ namespace faiss {
2525
* It allows low-level access to the encoding function, exposed mainly for unit
2626
* tests.
2727
*
28-
* @param n number of vectors to hanlde
28+
* @param n number of vectors to handle
2929
* @param residuals vectors to encode, size (n, beam_size, d)
3030
* @param cent centroids, size (K, d)
3131
* @param beam_size input beam size

faiss/impl/simd_result_handlers.h

+10-10
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ struct ReservoirHandler : ResultHandlerCompare<C, with_id_map> {
535535
}
536536
};
537537

538-
/** Result hanlder for range search. The difficulty is that the range distances
538+
/** Result handler for range search. The difficulty is that the range distances
539539
* have to be scaled using the scaler.
540540
*/
541541

@@ -713,7 +713,7 @@ struct PartialRangeHandler : RangeHandler<C, with_id_map> {
713713
*/
714714

715715
template <class C, bool W, class Consumer, class... Types>
716-
void dispatch_SIMDResultHanlder_fixedCW(
716+
void dispatch_SIMDResultHandler_fixedCW(
717717
SIMDResultHandler& res,
718718
Consumer& consumer,
719719
Types... args) {
@@ -733,19 +733,19 @@ void dispatch_SIMDResultHanlder_fixedCW(
733733
}
734734

735735
template <class C, class Consumer, class... Types>
736-
void dispatch_SIMDResultHanlder_fixedC(
736+
void dispatch_SIMDResultHandler_fixedC(
737737
SIMDResultHandler& res,
738738
Consumer& consumer,
739739
Types... args) {
740740
if (res.with_fields) {
741-
dispatch_SIMDResultHanlder_fixedCW<C, true>(res, consumer, args...);
741+
dispatch_SIMDResultHandler_fixedCW<C, true>(res, consumer, args...);
742742
} else {
743-
dispatch_SIMDResultHanlder_fixedCW<C, false>(res, consumer, args...);
743+
dispatch_SIMDResultHandler_fixedCW<C, false>(res, consumer, args...);
744744
}
745745
}
746746

747747
template <class Consumer, class... Types>
748-
void dispatch_SIMDResultHanlder(
748+
void dispatch_SIMDResultHandler(
749749
SIMDResultHandler& res,
750750
Consumer& consumer,
751751
Types... args) {
@@ -763,18 +763,18 @@ void dispatch_SIMDResultHanlder(
763763
}
764764
} else if (res.sizeof_ids == sizeof(int)) {
765765
if (res.is_CMax) {
766-
dispatch_SIMDResultHanlder_fixedC<CMax<uint16_t, int>>(
766+
dispatch_SIMDResultHandler_fixedC<CMax<uint16_t, int>>(
767767
res, consumer, args...);
768768
} else {
769-
dispatch_SIMDResultHanlder_fixedC<CMin<uint16_t, int>>(
769+
dispatch_SIMDResultHandler_fixedC<CMin<uint16_t, int>>(
770770
res, consumer, args...);
771771
}
772772
} else if (res.sizeof_ids == sizeof(int64_t)) {
773773
if (res.is_CMax) {
774-
dispatch_SIMDResultHanlder_fixedC<CMax<uint16_t, int64_t>>(
774+
dispatch_SIMDResultHandler_fixedC<CMax<uint16_t, int64_t>>(
775775
res, consumer, args...);
776776
} else {
777-
dispatch_SIMDResultHanlder_fixedC<CMin<uint16_t, int64_t>>(
777+
dispatch_SIMDResultHandler_fixedC<CMin<uint16_t, int64_t>>(
778778
res, consumer, args...);
779779
}
780780
} else {

faiss/invlists/BlockInvertedLists.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ void BlockInvertedLists::update_entries(
127127
size_t,
128128
const idx_t*,
129129
const uint8_t*) {
130-
FAISS_THROW_MSG("not impemented");
130+
FAISS_THROW_MSG("not implemented");
131131
}
132132

133133
BlockInvertedLists::~BlockInvertedLists() {

faiss/utils/distances.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ FAISS_API extern int distance_compute_blas_database_bs;
285285
// rather than a heap
286286
FAISS_API extern int distance_compute_min_k_reservoir;
287287

288-
/** Return the k nearest neighors of each of the nx vectors x among the ny
288+
/** Return the k nearest neighbors of each of the nx vectors x among the ny
289289
* vector y, w.r.t to max inner product.
290290
*
291291
* @param x query vectors, size nx * d
@@ -301,7 +301,7 @@ void knn_inner_product(
301301
float_minheap_array_t* res,
302302
const IDSelector* sel = nullptr);
303303

304-
/** Return the k nearest neighors of each of the nx vectors x among the ny
304+
/** Return the k nearest neighbors of each of the nx vectors x among the ny
305305
* vector y, for the inner product metric.
306306
*
307307
* @param x query vectors, size nx * d
@@ -320,7 +320,7 @@ void knn_inner_product(
320320
int64_t* indexes,
321321
const IDSelector* sel = nullptr);
322322

323-
/** Return the k nearest neighors of each of the nx vectors x among the ny
323+
/** Return the k nearest neighbors of each of the nx vectors x among the ny
324324
* vector y, for the L2 distance
325325
* @param x query vectors, size nx * d
326326
* @param y database vectors, size ny * d
@@ -338,7 +338,7 @@ void knn_L2sqr(
338338
const float* y_norm2 = nullptr,
339339
const IDSelector* sel = nullptr);
340340

341-
/** Return the k nearest neighors of each of the nx vectors x among the ny
341+
/** Return the k nearest neighbors of each of the nx vectors x among the ny
342342
* vector y, for the L2 distance
343343
*
344344
* @param x query vectors, size nx * d
@@ -413,7 +413,7 @@ void knn_L2sqr_by_idx(
413413
/// Forward declaration, see AuxIndexStructures.h
414414
struct RangeSearchResult;
415415

416-
/** Return the k nearest neighors of each of the nx vectors x among the ny
416+
/** Return the k nearest neighbors of each of the nx vectors x among the ny
417417
* vector y, w.r.t to max inner product
418418
*
419419
* @param x query vectors, size nx * d

faiss/utils/hamming.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ void fvec2bitvec(const float* __restrict x, uint8_t* __restrict b, size_t d) {
364364
}
365365

366366
/* Same but for n vectors.
367-
Ensure that the ouptut b is byte-aligned (pad with 0s). */
367+
Ensure that the output b is byte-aligned (pad with 0s). */
368368
void fvecs2bitvecs(
369369
const float* __restrict x,
370370
uint8_t* __restrict b,

0 commit comments

Comments
 (0)