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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make image reading ops return tensors in CHW #2616

Closed
fmassa opened this issue Aug 25, 2020 · 0 comments 路 Fixed by #2680
Closed

Make image reading ops return tensors in CHW #2616

fmassa opened this issue Aug 25, 2020 · 0 comments 路 Fixed by #2680

Comments

@fmassa
Copy link
Member

fmassa commented Aug 25, 2020

馃殌 Feature

Motivation

All PyTorch operations (and our torchvision transforms) assume that images are in CHW format.
Traditionally, images are stored in HWC format, and for now we are returning contiguous tensors in HWC format.

I believe what we should do is to return non-contiguous tensors in CHW format, so that loading is as efficient as possible, and we can utilize channels_last format implementations for the operations (which are faster than the channels_first for a number of cases).

Pitch

Add .permute(2, 0, 1) after the image reading operations (in C++).

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

Successfully merging a pull request may close this issue.

2 participants