Skip to content

Update RandomErasing value type and doc string #9154

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

Closed
wants to merge 6 commits into from

Conversation

rob-luke
Copy link

When using RandomErasing i was receiving type errors due to the restricted float type for value. I have updated the type hinting and docstring to reflect the range of possible types (Union[float, int, str, Sequence[Union[float, int]]]).

Thanks for the great package!

Copy link

pytorch-bot bot commented Jul 21, 2025

🔗 Helpful Links

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

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 Jul 21, 2025
@rob-luke
Copy link
Author

I think I have fixed all the ufmt and type errors, could you please approve the workflows again?

@NicolasHug
Copy link
Member

NicolasHug commented Aug 8, 2025

Hi @rob-luke , sorry I don't think this is something we'll be able to merge.

The type annotations of torchvision are unfortunately wrong in plenty of places. Those annotations primarily exist for torchscript tor work, and sadly torchscript and mypy and other type-checkers typically differ and disagree on what is a valid annotation.

@rob-luke
Copy link
Author

rob-luke commented Aug 8, 2025

Thanks for letting me know @NicolasHug

@rob-luke rob-luke closed this Aug 8, 2025
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.

2 participants