Skip to content

Fix docstring for 'fill' in transforms without 'padding_mode' #9171

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
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

abhitorch81
Copy link

Summary

This PR applies the minimum docstring fix for fill, as discussed in #9149.

Replaced:

Pixel fill value used when the padding_mode is constant.

With:

Pixel fill value used for pixels outside the image boundary.

This corrects the docstring in transforms like ElasticTransform, RandomAffine, etc., which do not have a padding_mode parameter.

No functional changes made.

Fixes: #9149

Hi @diaz-esparza — no worries at all, and thank you for your thoughtful message!

I’ve gone ahead and applied the minimum docstring fix as discussed in the issue, specifically removing the misleading reference to padding_mode and updating the fill parameter description for clarity.

You’re of course very welcome to iterate or build on top of it — especially if you’re still considering the more advanced version as a feature enhancement.

Appreciate your openness to feedback — and honestly, your explanation and tone were already clear and friendly! Looking forward to your thoughts on the PR

Copy link

pytorch-bot bot commented Aug 7, 2025

🔗 Helpful Links

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

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

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

@meta-cla meta-cla bot added the cla signed label Aug 7, 2025
@diaz-esparza
Copy link

pixels outside the image boundary is a really nice way of putting it, props on that!

On that note though, please be careful with a few things about the change. Mainly, you've also altered the Pad and RandomCrop docstrings, and I think it's important on those two to keep the padding_mode reference given that the fill parameter is only useful when the other one is set to "constant". Both reverting the change or putting [...] for pixels outside the image boundary when the ``padding_mode`` is constant should be fine!

Also I think there's a misindentation on the RandomAffine docstring and an extra line in RandomCrop, please be on the lookout for that kind of stuff :)

@abhitorch81
Copy link
Author

pixels outside the image boundary is a really nice way of putting it, props on that!

On that note though, please be careful with a few things about the change. Mainly, you've also altered the Pad and RandomCrop docstrings, and I think it's important on those two to keep the padding_mode reference given that the fill parameter is only useful when the other one is set to "constant". Both reverting the change or putting [...] for pixels outside the image boundary when thepadding_modeis constant should be fine!

Also I think there's a misindentation on the RandomAffine docstring and an extra line in RandomCrop, please be on the lookout for that kind of stuff :)

I will keep that in mind and update the PR.

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.

Transforms v2 documentation not congruent w/ fn parameters (padding_mode)
2 participants