Skip to content

fix vanilla tensor image detection #5518

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

Merged
merged 3 commits into from
Mar 5, 2022

Conversation

pmeier
Copy link
Collaborator

@pmeier pmeier commented Mar 3, 2022

We missed that in #5421. Although we often do isinstance(input, torch.Tensor) in the stable implementation, we can no longer do that for the prototypes. Since features._Feature is also a torch.Tensor, everything not explicitly handled before the isinstance(input, torch.Tensor) condition would be treated as image. For example

from torchvision.prototype import features, transforms

sample = dict(label=features.Label(0))
transform = transforms.Resize((32, 32))

transform(sample)
TypeError: Tensor is not a torch image.

@facebook-github-bot
Copy link

facebook-github-bot commented Mar 3, 2022

💊 CI failures summary and remediations

As of commit 260c6fe (more details on the Dr. CI page):


💚 💚 Looks good so far! There are no failures yet. 💚 💚


This comment was automatically generated by Dr. CI (expand for details).

Please report bugs/suggestions to the (internal) Dr. CI Users group.

Click here to manually regenerate this comment.

@pmeier pmeier requested a review from datumbox March 4, 2022 15:40
@datumbox datumbox merged commit 50608fb into pytorch:main Mar 5, 2022
@pmeier pmeier deleted the vanilla-tensor-image branch March 5, 2022 09:24
facebook-github-bot pushed a commit that referenced this pull request Mar 15, 2022
Summary:
* fix vanilla tensor image detection

* fix naming

Reviewed By: vmoens

Differential Revision: D34878991

fbshipit-source-id: cbe7f908bde0b2cfb90a7174ebc65daebe6fa09e

Co-authored-by: Vasilis Vryniotis <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants