Specify number of cores in search
This commit is contained in:
parent
637e481c6f
commit
116432d2c5
@ -37,7 +37,7 @@ class FLANNIndex(object):
|
|||||||
elif isinstance(query, T.Tensor):
|
elif isinstance(query, T.Tensor):
|
||||||
query = query.cpu().numpy()
|
query = query.cpu().numpy()
|
||||||
|
|
||||||
l, d = self.index.nn_index(query, num_neighbors=self.K if k is None else k)
|
l, d = self.index.nn_index(query, num_neighbors=self.K if k is None else k, cores=4)
|
||||||
|
|
||||||
distances = T.from_numpy(d).float()
|
distances = T.from_numpy(d).float()
|
||||||
labels = T.from_numpy(l).long()
|
labels = T.from_numpy(l).long()
|
||||||
|
Loading…
Reference in New Issue
Block a user