Skip to content

Fix test_backbone_utils by adding .float() before .mean() #6090

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

Conversation

YosuaMichael
Copy link
Contributor

In test_backbone_utils.TestFxFeatureExtraction, there is edge case when the sampled nodes are buffer and does not depend on input and has integer value (example on swin transformer).

In this case, the test will trigger error because Tensor.mean does not accept integer.
This PR provide a fix by adding .float() before .mean().

Copy link
Contributor

@datumbox datumbox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @YosuaMichael. Feel free to merge once the CI is green.

@YosuaMichael YosuaMichael merged commit 665b835 into pytorch:main May 25, 2022
YosuaMichael added a commit to YosuaMichael/vision that referenced this pull request May 25, 2022
datumbox pushed a commit that referenced this pull request May 26, 2022
facebook-github-bot pushed a commit that referenced this pull request Jun 1, 2022
…e .mean() dont accept integer dtype (#6090)

Reviewed By: NicolasHug

Differential Revision: D36760937

fbshipit-source-id: dfe3ef93953f9f7d4e55cefa40f177e574a5271f
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