nmslib should use flatnonzero as well
from __future__ import absolute_import
import os
import nmslib
+import numpy as np
import scipy.sparse
from ann_benchmarks.constants import INDEX_DIR
from ann_benchmarks.algorithms.base import BaseANN
@@ -14,7 +15,7 @@ def sparse_matrix_to_str(matrix):
return result
def dense_vector_to_str(vector):
- indices = vector.nonzero()[0]
+ indices = np.flatnonzero(vector)
result = ' '.join([str(k) for k in indices])
return result
