Skip to content

Commit

Permalink
Merge branch 'main' into export-D67299378
Browse files Browse the repository at this point in the history
  • Loading branch information
asadoughi authored Dec 19, 2024
2 parents 4bd04e9 + 0a0af00 commit 6f06bef
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/actions/build_conda/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,12 @@ runs:
- name: Install conda build tools
shell: ${{ steps.choose_shell.outputs.shell }}
run: |
conda install -y -q "conda!=24.11.0"
conda install -y -q "conda-build!=24.11.0"
conda install -y "conda!=24.11.0"
conda install -y "conda-build!=24.11.0"
- name: Fix CI failure
shell: ${{ steps.choose_shell.outputs.shell }}
if: runner.os != 'Windows'
run: conda remove conda-anaconda-telemetry
- name: Enable anaconda uploads
if: inputs.label != ''
shell: ${{ steps.choose_shell.outputs.shell }}
Expand Down
14 changes: 14 additions & 0 deletions tests/test_ivf_index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,20 @@ TEST(IVF, list_context) {
EXPECT_EQ(nb, context.list_nos.size())
<< "should have correct number of list numbers";
}
{
constexpr size_t num_vecs = 5; // number of vectors
std::vector<float> vecs(num_vecs * d);
for (size_t i = 0; i < num_vecs * d; i++) {
vecs[i] = distrib(rng);
}
const size_t codeSize = index.sa_code_size();
std::vector<uint8_t> encodedData(num_vecs * codeSize);
index.sa_encode(num_vecs, vecs.data(), encodedData.data());
std::vector<float> decodedVecs(num_vecs * d);
index.sa_decode(num_vecs, encodedData.data(), decodedVecs.data());
EXPECT_EQ(vecs, decodedVecs)
<< "decoded vectors should be the same as the original vectors that were encoded";
}
{
constexpr faiss::idx_t k = 100;
constexpr size_t nprobe = 10;
Expand Down

0 comments on commit 6f06bef

Please sign in to comment.