Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indices on gpu #544

Open
jc211 opened this issue Mar 10, 2025 · 1 comment
Open

Indices on gpu #544

jc211 opened this issue Mar 10, 2025 · 1 comment

Comments

@jc211
Copy link

jc211 commented Mar 10, 2025

🚀 The feature

Is there a way to have the decoder take in a tensor of indices that are already on the gpu and return a tensor of the same shape. For example if inds is indices of shape (..., 1), I = decoder[inds] returns I of shape (..., H,W, C).

Motivation, pitch

No response

@NicolasHug
Copy link
Member

NicolasHug commented Mar 11, 2025

Hi @jc211 ,

Indices need to be on CPU, and because of the underlying implementation, I doubt that having indices on GPU will ever speed-up decoding.

For the expected shape: we don't support arbitrary input dimensions for the indices, but you should be able to flatten the indices tensor, call decoder.get_frames_at_indices(flat_indices), and then re-shape the output tensor to the original shape.

Out of curiosity, why does your tensor of indices have some leading dimension?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants