diff --git a/benchs/bench_6bit_codec.cpp b/benchs/bench_6bit_codec.cpp index 5e7fe6dc9f..b4ac0b04b6 100644 --- a/benchs/bench_6bit_codec.cpp +++ b/benchs/bench_6bit_codec.cpp @@ -76,6 +76,6 @@ static void bench(benchmark::State& state) { } } // I think maybe n and d should be input arguments -// for thigns to really make sense, idk. +// for things to really make sense, idk. BENCHMARK(bench)->Iterations(20); BENCHMARK_MAIN(); diff --git a/c_api/Index_c.h b/c_api/Index_c.h index f34d294e50..a961beb7a9 100644 --- a/c_api/Index_c.h +++ b/c_api/Index_c.h @@ -115,7 +115,7 @@ int faiss_Index_search( idx_t* labels); /** - * query n vectors of dimension d with seach parameters to the index. + * query n vectors of dimension d with search parameters to the index. * * return at most k vectors. If there are not enough results for a query, * the result is padded with -1s. diff --git a/demos/demo_imi_flat.cpp b/demos/demo_imi_flat.cpp index 7713da4a8c..1480422ac6 100644 --- a/demos/demo_imi_flat.cpp +++ b/demos/demo_imi_flat.cpp @@ -43,7 +43,7 @@ int main() { // // We here assume that its lifespan of this coarse quantizer will cover the // lifespan of the inverted-file quantizer IndexIVFFlat below - // With dynamic allocation, one may give the responsability to free the + // With dynamic allocation, one may give the responsibility to free the // quantizer to the inverted-file index (with attribute do_delete_quantizer) // // Note: a regular clustering algorithm would be defined as: diff --git a/demos/demo_imi_pq.cpp b/demos/demo_imi_pq.cpp index b20aefb825..a2af65e792 100644 --- a/demos/demo_imi_pq.cpp +++ b/demos/demo_imi_pq.cpp @@ -44,7 +44,7 @@ int main() { // // We here assume that its lifespan of this coarse quantizer will cover the // lifespan of the inverted-file quantizer IndexIVFFlat below - // With dynamic allocation, one may give the responsability to free the + // With dynamic allocation, one may give the responsibility to free the // quantizer to the inverted-file index (with attribute do_delete_quantizer) // // Note: a regular clustering algorithm would be defined as: diff --git a/faiss/IndexIVF.cpp b/faiss/IndexIVF.cpp index 6139ece448..0bb10de4be 100644 --- a/faiss/IndexIVF.cpp +++ b/faiss/IndexIVF.cpp @@ -376,7 +376,7 @@ void IndexIVF::search( indexIVF_stats.add(stats[slice]); } } else { - // handle paralellization at level below (or don't run in parallel at + // handle parallelization at level below (or don't run in parallel at // all) sub_search_func(n, x, distances, labels, &indexIVF_stats); } diff --git a/faiss/IndexShards.cpp b/faiss/IndexShards.cpp index e8074469fd..716e69a594 100644 --- a/faiss/IndexShards.cpp +++ b/faiss/IndexShards.cpp @@ -147,7 +147,7 @@ void IndexShardsTemplate::add_with_ids( "request them to be shifted"); FAISS_THROW_IF_NOT_MSG( this->ntotal == 0, - "when adding to IndexShards with sucessive_ids, " + "when adding to IndexShards with successive_ids, " "only add() in a single pass is supported"); } diff --git a/faiss/IndexShardsIVF.cpp b/faiss/IndexShardsIVF.cpp index 9a68f3eb77..fa6272d297 100644 --- a/faiss/IndexShardsIVF.cpp +++ b/faiss/IndexShardsIVF.cpp @@ -111,7 +111,7 @@ void IndexShardsIVF::add_with_ids( "request them to be shifted"); FAISS_THROW_IF_NOT_MSG( this->ntotal == 0, - "when adding to IndexShards with sucessive_ids, " + "when adding to IndexShards with successive_ids, " "only add() in a single pass is supported"); } diff --git a/faiss/impl/ProductQuantizer.cpp b/faiss/impl/ProductQuantizer.cpp index 822cd90d72..0c048e7c3e 100644 --- a/faiss/impl/ProductQuantizer.cpp +++ b/faiss/impl/ProductQuantizer.cpp @@ -405,7 +405,7 @@ void ProductQuantizer::compute_codes(const float* x, uint8_t* codes, size_t n) for (int64_t i = 0; i < n; i++) compute_code(x + i * d, codes + i * code_size); - } else { // worthwile to use BLAS + } else { // worthwhile to use BLAS float* dis_tables = new float[n * ksub * M]; ScopeDeleter del(dis_tables); compute_distance_tables(n, x, dis_tables); diff --git a/faiss/impl/ProductQuantizer.h b/faiss/impl/ProductQuantizer.h index e408773746..d43dd5d578 100644 --- a/faiss/impl/ProductQuantizer.h +++ b/faiss/impl/ProductQuantizer.h @@ -35,7 +35,7 @@ struct ProductQuantizer : Quantizer { enum train_type_t { Train_default, Train_hot_start, ///< the centroids are already initialized - Train_shared, ///< share dictionary accross PQ segments + Train_shared, ///< share dictionary across PQ segments Train_hypercube, ///< initialize centroids with nbits-D hypercube Train_hypercube_pca, ///< initialize centroids with nbits-D hypercube }; diff --git a/faiss/utils/partitioning.cpp b/faiss/utils/partitioning.cpp index 7cceaf0fd0..5edfd6feb6 100644 --- a/faiss/utils/partitioning.cpp +++ b/faiss/utils/partitioning.cpp @@ -882,7 +882,7 @@ static const simd32uint8 shifts = simd32uint8::create< // 2-bit accumulator: we can add only up to 3 elements // on output we return 2*4-bit results // preproc returns either an index in 0..7 or 0xffff -// that yeilds a 0 when used in the table look-up +// that yields a 0 when used in the table look-up template void compute_accu2( const uint16_t*& data, diff --git a/faiss/utils/utils.cpp b/faiss/utils/utils.cpp index 0a4f9a7719..d40f14eae8 100644 --- a/faiss/utils/utils.cpp +++ b/faiss/utils/utils.cpp @@ -430,8 +430,8 @@ void bincode_hist(size_t n, size_t nbits, const uint8_t* codes, int* hist) { } } -uint64_t ivec_checksum(size_t n, const int32_t* asigned) { - const uint32_t* a = reinterpret_cast(asigned); +uint64_t ivec_checksum(size_t n, const int32_t* assigned) { + const uint32_t* a = reinterpret_cast(assigned); uint64_t cs = 112909; while (n--) { cs = cs * 65713 + a[n] * 1686049; diff --git a/tests/test_io.py b/tests/test_io.py index 8ba2d13b41..dc8ac3dcfb 100644 --- a/tests/test_io.py +++ b/tests/test_io.py @@ -80,7 +80,7 @@ def do_write_callback(self, bsz): faiss.vector_to_array(index2.codes) ) - # This is not a callable function: shoudl raise an exception + # This is not a callable function: should raise an exception writer = faiss.PyCallbackIOWriter("blabla") self.assertRaises( Exception,