Skip to content

Commit 97a980e

Browse files
author
Uri Goren
authored
Update LazyIndex.py
1 parent 3e158d9 commit 97a980e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

python_bindings/LazyIndex.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ def __init__(self, space, dim,max_elements=1024, ef_construction=200, M=16):
88
self.init_max_elements=max_elements
99
self.init_ef_construction=ef_construction
1010
self.init_M=M
11-
def init_index(self, max_elements=0,M=None,ef_construction=None):
12-
if max_elements==0:
13-
max_elements=self.init_max_elements
14-
if ef_construction:
11+
def init_index(self, max_elements=0,M=0,ef_construction=0):
12+
if max_elements>0:
13+
self.init_max_elements=max_elements
14+
if ef_construction>0:
1515
self.init_ef_construction=ef_construction
16-
if M:
16+
if M>0:
1717
self.init_M=M
18-
super().init_index(max_elements, self.init_M, self.init_ef_construction)
18+
super().init_index(self.init_max_elements, self.init_M, self.init_ef_construction)
1919
def add_items(self, data, ids=None, num_threads=-1):
2020
if self.max_elements==0:
2121
self.init_index()

0 commit comments

Comments
 (0)