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

Allow catch-all 'others' key in fill dicts. Avoid need for defaultdict. #7779

Merged
merged 6 commits into from
Aug 1, 2023

Conversation

NicolasHug
Copy link
Member

@NicolasHug NicolasHug commented Jul 31, 2023

Closes #7765

cc @vfdev-5

@pytorch-bot
Copy link

pytorch-bot bot commented Jul 31, 2023

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/vision/7779

Note: Links to docs will display an error until the docs builds have been completed.

❌ 3 New Failures

As of commit e19cf4a:

NEW FAILURES - The following jobs have failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

Comment on lines +59 to +60
else:
return {"others": _convert_fill_arg(fill)}
Copy link
Member Author

Choose a reason for hiding this comment

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

Not obvious from the diff but this line simply replaces the previous

return _get_defaultdict(_convert_fill_arg(fill))

This is the most important part of this diff, along with the new calls to _get_fill() defined below.

from torchvision.transforms.v2.utils import is_simple_tensor


T = TypeVar("T")
Copy link
Member Author

Choose a reason for hiding this comment

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

These are prototype transforms that rely on _get_defaultdict() for another parameter. I couldn't be bothered to update them so I just ported the code here.

Copy link
Contributor

@pmeier pmeier left a comment

Choose a reason for hiding this comment

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

LGTM if CI is green. Thanks Nicolas!

references/segmentation/v2_extras.py Outdated Show resolved Hide resolved
@NicolasHug NicolasHug merged commit edde825 into pytorch:main Aug 1, 2023
58 of 61 checks passed
@github-actions
Copy link

github-actions bot commented Aug 1, 2023

Hey @NicolasHug!

You merged this PR, but no labels were added. The list of valid labels is available at https://github.com/pytorch/vision/blob/main/.github/process_commit.py

facebook-github-bot pushed a commit that referenced this pull request Aug 25, 2023
…efaultdict. (#7779)

Reviewed By: matteobettini

Differential Revision: D48642294

fbshipit-source-id: 2a19dd8647bd66f0449ad196b2bf0723862d95db
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.

Allow "others" key as a catch-all in dictionary parameters
3 participants