Skip to content

Add uint8 support for interpolate and grid-sample in PyTorch #2289

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

Open
fmassa opened this issue Jun 5, 2020 · 4 comments
Open

Add uint8 support for interpolate and grid-sample in PyTorch #2289

fmassa opened this issue Jun 5, 2020 · 4 comments

Comments

@fmassa
Copy link
Member

fmassa commented Jun 5, 2020

🚀 Feature

With the addition of torch tensor support for the transforms (following #1375), there are two operators that will require extra attention in order for them to be as efficient as the PIL implementations.

Indeed, while we can implement resize via torch.nn.functional.interpolate and rotate via torch.nn.functional.grid_sample, those operators for now only support floating-point types, so for now we need to perform a .float() -> interpolate() -> byte() in order to maintain compatibility, which is wasteful.

It would be great if they could be extended to support uint8 (and maybe other integer types) as well.

A first PR adding support for uint8 to nearest mode interpolate has been sent in pytorch/pytorch#35029

Something to keep in mind: the interpolate function is under optimization in pytorch/pytorch#34864, so this should be kept in mind to avoid conflicts.

@karthikprasad
Copy link

Curious to know if this issue is still high priority? I am especially interested in uint8 support for interpolate in bilinear mode.

@zhiqwang
Copy link
Contributor

Hi @karthikprasad , You can see the progression on this #6619 (comment)

@NicolasHug
Copy link
Member

Hi @karthikprasad , this is planned work, but without a real ETA yet. If this is useful to you, we may be able to bump the priority. I'll reach out internally

@NicolasHug
Copy link
Member

I started working on this in pytorch/pytorch#87863

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

No branches or pull requests

5 participants