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
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 means len(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.
The text was updated successfully, but these errors were encountered:
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()
andget_frames_at()
to support:-n
just meanslen(decoder) - n
.len(decoder)
.In short we should allow for that kind of stuff:
In terms of implementation, we can implement this within the
SimpleVideoDecoder
class in Python. No need to extend the core or C++ APIs.The text was updated successfully, but these errors were encountered: