Open
Description
For consistency with tensor indexing semantics and with builtin Python indexing of sequences, we should extend the index-based APIs of SimpleVideoDecoder
, namely __getitem__()
, get_frame_at()
and get_frames_at()
to support:
- negative indexing.
-n
just meanslen(decoder) - n
. - upper bound in slices to be greated than
len(decoder)
.
In short we should allow for that kind of stuff:
>>> torch.arange(10)[-3:1000]
tensor([7, 8, 9])
In terms of implementation, we can implement this within the SimpleVideoDecoder
class in Python. No need to extend the core or C++ APIs.