Skip to content

Update typehint for fill arg in rotate #6594

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 2 commits into from
Sep 16, 2022
Merged

Conversation

vfdev-5
Copy link
Collaborator

@vfdev-5 vfdev-5 commented Sep 16, 2022

Description:

  • Update typehint for fill arg in rotate, mainly
- fill: Optional[List[float]] = None,
+ fill: Optional[Union[int, float, List[float]]] = None,

(we can't add List[int] into the typehint as JIT does not know how to iterate over the list: 'Union[List[float], List[int]]' object is not iterable)

Underlying functions are already almost supporting scalar values.

Next steps:

  • update fill arg to affine, perspective, elastic etc
  • refactor pad_image_tensor to have the same typehint

@vfdev-5 vfdev-5 marked this pull request as ready for review September 16, 2022 08:43
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!

@vfdev-5 vfdev-5 merged commit c0911e3 into pytorch:main Sep 16, 2022
@vfdev-5 vfdev-5 deleted the enh-fill-typehint branch September 16, 2022 09:47
@github-actions
Copy link

Hey @vfdev-5!

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 Sep 23, 2022
Reviewed By: NicolasHug

Differential Revision: D39765308

fbshipit-source-id: 607187eb9d734ff318656233e4a1f986a5378ecb
@frgfm frgfm mentioned this pull request Oct 26, 2022
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