Skip to content

Commit

Permalink
stop dealloc of coarse quantizer when it is deleted (#2603)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #2603

X-link: facebookresearch/faiss#4045

Need to add to `__init__.py` like Matthijs mentioned on the github issue facebookresearch/faiss#3993. But we can't do it for non-GPU code, otherwise it will throw an exception and fail many tests than include fbcode/faiss. So we need to check if FAISS GPU is importable first.

To find the class names like GpuIndexIVFFlat etc, I checked everything under faiss/gpu where the constructor accepts an Index. The other Index is always parameter at index 1 (0-indexed), so that's why we use 1 in the function calls.

Reviewed By: pankajsingh88

Differential Revision: D66675910

fbshipit-source-id: f170dadb6318c620420689164f9522f9815aa980
  • Loading branch information
Michael Norris authored and facebook-github-bot committed Dec 4, 2024
1 parent af4cb11 commit 40a3727
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion examples/retrieval/knn_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ def get_index(
res = faiss.StandardGpuResources()
# pyre-fixme[16]
config = faiss.GpuIndexIVFPQConfig()
# pyre-ignore[16]
index = faiss.GpuIndexIVFPQ(
res,
embedding_dim,
Expand Down

0 comments on commit 40a3727

Please sign in to comment.