You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When calling Index.get() with a key that doesn't exist in the index, it sometimes returns the vector of some values, instead of consistently returning None as specified in the official documentation.
Interestingly, trying to access the key -1 gives values which change over time, while too-large keys seems to give the last embedding again (as in the reporter's case)
x = usearch_index.Index(metric='IP', dtype=uindex.ScalarKind(12), ndim=3)
embs = np.float16(np.random.normal(scale=1e-4, size=[128, 3]))
x.add(np.arange(128), embs)
for i in (-2, -1, 0, 127, 128, 256):
print(i)
print(x.get(i))
print(x.get(i))
if i < 128:
print(embs[i])
Describe the bug
When calling Index.get() with a key that doesn't exist in the index, it sometimes returns the vector of some values, instead of consistently returning None as specified in the official documentation.
Steps to reproduce
Code to Reproduce
Output:
The last two lines should be
False None
Expected behavior
As document noted, it should return None, if one key is requested and its not present.
USearch version
2.15.1
Operating System
macOS Sonoma
Hardware architecture
Arm
Which interface are you using?
Python bindings
Contact Details
No response
Are you open to being tagged as a contributor?
.git
history as a contributorIs there an existing issue for this?
Code of Conduct
The text was updated successfully, but these errors were encountered: