Skip to content

Commit ff1d543

Browse files
generatedunixname2094418054467506meta-codesync[bot]
authored andcommitted
Fix python_unnecessary_generator_set_comprehension issues in faiss/tests/test_fastscan_filter.py (#5215)
Summary: Pull Request resolved: #5215 Reviewed By: limqiying Differential Revision: D105298175 fbshipit-source-id: 5f5ae0297f7b836a69359cf4cf72b236e4fea553
1 parent a9f5baa commit ff1d543

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

tests/test_fastscan_filter.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,13 @@ def do_test_filter(
6565
])
6666
inner_sel = faiss.IDSelectorBatch(excluded)
6767
sel = faiss.IDSelectorNot(inner_sel)
68-
allowed = set(i for i in range(nb) if i not in excluded)
68+
allowed = {i for i in range(nb) if i not in excluded}
6969
elif id_selector_type == "partial_batch":
7070
# Exclude a few IDs within a single block (not a whole block)
7171
excluded = np.array([5, 10, 20, 31], dtype="int64")
7272
inner_sel = faiss.IDSelectorBatch(excluded)
7373
sel = faiss.IDSelectorNot(inner_sel)
74-
allowed = set(i for i in range(nb) if i not in excluded)
74+
allowed = {i for i in range(nb) if i not in excluded}
7575
elif id_selector_type == "empty":
7676
sel = faiss.IDSelectorBatch(np.array([], dtype="int64"))
7777
allowed = set()
@@ -213,7 +213,7 @@ def test_blockskip_consistency_with_ivfpq(self):
213213
])
214214
inner_sel = faiss.IDSelectorBatch(excluded)
215215
sel = faiss.IDSelectorNot(inner_sel)
216-
allowed = set(i for i in range(nb) if i not in excluded)
216+
allowed = {i for i in range(nb) if i not in excluded}
217217

218218
# FastScan index
219219
index_fs = faiss.index_factory(d, "IVF32,PQ4x4fs")

0 commit comments

Comments
 (0)