Skip to content

Commit 0825eaf

Browse files
Sugosh Nagavara Ravindrafacebook-github-bot
authored andcommitted
Include IndexResidual in clone_index
Summary: Moving index from cpu to gpu is failing with error message `RuntimeError: Error in virtual faiss::Index *faiss::Cloner::clone_Index(const faiss::Index *) at faiss/clone_index.cpp:144: clone not supported for this type of Index` This diff support IndexResidual clone and unblocks gpu training Reviewed By: sc268, mdouze Differential Revision: D28614996 fbshipit-source-id: 9b1e5e7c5dd5da6d55f02594b062691565a86f49
1 parent d5a1bf3 commit 0825eaf

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

faiss/clone_index.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include <faiss/IndexNSG.h>
2828
#include <faiss/IndexPQ.h>
2929
#include <faiss/IndexPreTransform.h>
30+
#include <faiss/IndexResidual.h>
3031
#include <faiss/IndexScalarQuantizer.h>
3132
#include <faiss/MetaIndexes.h>
3233
#include <faiss/VectorTransform.h>
@@ -79,6 +80,7 @@ Index* Cloner::clone_Index(const Index* index) {
7980
TRYCLONE(IndexFlatIP, index)
8081
TRYCLONE(IndexFlat, index)
8182
TRYCLONE(IndexLattice, index)
83+
TRYCLONE(IndexResidual, index)
8284
TRYCLONE(IndexScalarQuantizer, index)
8385
TRYCLONE(MultiIndexQuantizer, index)
8486
if (const IndexIVF* ivf = dynamic_cast<const IndexIVF*>(index)) {

0 commit comments

Comments
 (0)