Skip to content

Proper tensor support for get_frames_at() and get_frames_played_at(). #879

@NicolasHug

Description

@NicolasHug

We used to implicitly support tensor indices() in get_frames_at(indices), even though the type annotation clearly mention list[int]. In https://github.com/pytorch/torchcodec/pull/746/files#diff-4f95b28922233b6ec6f41a7264a5518af7ea7dfb11329b133d378f9701e3cad0L224-L227 we "broke" that implicit tensor support. This broke transformers (#877), so we re-enabled implicit tensor support in #880.

The current implicit tensor support isn't great: we're converting the tensor to a list which will then be converted to an array of int. We should just natively accept tensors, avoid copies, and make tensor support official and public.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions