Skip to content

Commit

Permalink
Fix some typos (#3056)
Browse files Browse the repository at this point in the history
Summary: Pull Request resolved: #3056

Reviewed By: pemazare

Differential Revision: D49617607

Pulled By: mlomeli1

fbshipit-source-id: b2d5df67e88e029882e697597af9f3fc8fe1e64c
  • Loading branch information
chasingegg authored and facebook-github-bot committed Sep 27, 2023
1 parent d85601d commit 6218111
Show file tree
Hide file tree
Showing 12 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion benchs/bench_6bit_codec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
2 changes: 1 addition & 1 deletion c_api/Index_c.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion demos/demo_imi_flat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion demos/demo_imi_pq.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion faiss/IndexIVF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion faiss/IndexShards.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ void IndexShardsTemplate<IndexT>::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");
}

Expand Down
2 changes: 1 addition & 1 deletion faiss/IndexShardsIVF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}

Expand Down
2 changes: 1 addition & 1 deletion faiss/impl/ProductQuantizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<float> del(dis_tables);
compute_distance_tables(n, x, dis_tables);
Expand Down
2 changes: 1 addition & 1 deletion faiss/impl/ProductQuantizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
Expand Down
2 changes: 1 addition & 1 deletion faiss/utils/partitioning.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <int N, class Preproc>
void compute_accu2(
const uint16_t*& data,
Expand Down
4 changes: 2 additions & 2 deletions faiss/utils/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<const uint32_t*>(asigned);
uint64_t ivec_checksum(size_t n, const int32_t* assigned) {
const uint32_t* a = reinterpret_cast<const uint32_t*>(assigned);
uint64_t cs = 112909;
while (n--) {
cs = cs * 65713 + a[n] * 1686049;
Expand Down
2 changes: 1 addition & 1 deletion tests/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 6218111

Please sign in to comment.