Deal with sparse search function case
@@ -78,7 +78,14 @@ class PyNNDescent(BaseANN):
n_search_trees=self._n_search_trees,
verbose=True,
)
+ if hasattr(self._index, "prepare"):
+ self._index.prepare()
+ else:
self._index._init_search_graph()
+ if self._index._is_sparse:
+ if hasattr(self._index, "_init_sparse_search_function"):
+ self._index._init_sparse_search_function()
+ else:
if hasattr(self._index, "_init_search_function"):
self._index._init_search_function()
