Skip to content

Commit

Permalink
Update LazyIndex.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Uri Goren authored Nov 30, 2021
1 parent 3e158d9 commit 97a980e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions python_bindings/LazyIndex.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ def __init__(self, space, dim,max_elements=1024, ef_construction=200, M=16):
self.init_max_elements=max_elements
self.init_ef_construction=ef_construction
self.init_M=M
def init_index(self, max_elements=0,M=None,ef_construction=None):
if max_elements==0:
max_elements=self.init_max_elements
if ef_construction:
def init_index(self, max_elements=0,M=0,ef_construction=0):
if max_elements>0:
self.init_max_elements=max_elements
if ef_construction>0:
self.init_ef_construction=ef_construction
if M:
if M>0:
self.init_M=M
super().init_index(max_elements, self.init_M, self.init_ef_construction)
super().init_index(self.init_max_elements, self.init_M, self.init_ef_construction)
def add_items(self, data, ids=None, num_threads=-1):
if self.max_elements==0:
self.init_index()
Expand Down

0 comments on commit 97a980e

Please sign in to comment.