Skip to content

Commit 117aafd

Browse files
mjs2600facebook-github-bot
authored andcommitted
Fix Type Error in Conditional Logic (#4294)
Summary: The old logic was asking for `D`'s shape, which indicated that it should be a NumPy array. However, if you check the truth value of a NumPy array, you get an error. The code is checking for the existence of `D`. The most direct way to handle that is to make sure that it isn't `None`. Pull Request resolved: #4294 Reviewed By: junjieqi Differential Revision: D72972114 Pulled By: mnorris11 fbshipit-source-id: 4ffabcccfd7418f625a379b8c3684d83bf57cac7
1 parent 928333c commit 117aafd

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

faiss/python/class_wrappers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1038,7 +1038,7 @@ def replacement_vt_train(self, x):
10381038

10391039
def handle_AutoTuneCriterion(the_class):
10401040
def replacement_set_groundtruth(self, D, I):
1041-
if D:
1041+
if D is not None:
10421042
assert I.shape == D.shape
10431043
self.nq, self.gt_nnn = I.shape
10441044
self.set_groundtruth_c(

0 commit comments

Comments
 (0)