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
{{ message }}
This repository was archived by the owner on Sep 9, 2026. It is now read-only.
Concretely, we should be able to do the following:
da=DocumentArray([... for_inrange(5)]
da[0] # index by offset; returns doc at this positionda[0:5:2] # index by slice; returns every other docda[0, 1, 2] # index by sequence of positions; returns DocumentArray with docs at these positionsda[[0, 1, 2]] # same as aboveda[[True, False, True, True, False]] # index by boolean mask; returns DocumentArray with "True" docsda[None] # returns `da`, just to conform with PyTorch convention
PyTorch (and numpy, too) supports a rich and flexible indexing API: https://pytorch.org/cppdocs/notes/tensor_indexing.html
DocumentArrayStacked should support the same.
Concretely, we should be able to do the following: