Skip to content

Relax mypy in prototype namespace #7091

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 3 commits into from
Jan 16, 2023
Merged

Conversation

pmeier
Copy link
Collaborator

@pmeier pmeier commented Jan 16, 2023

See 2. in #7084 (review).

cc @bjuncek

@@ -7,7 +7,7 @@ allow_redefinition = True
no_implicit_optional = True
warn_redundant_casts = True

[mypy-torchvision.prototype.features.*]
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Driveby

@@ -98,7 +98,7 @@ def __torch_function__(
# `args = (torch.Tensor(), datapoints.Image())` first. Without this guard, the original `torch.Tensor` would
# be wrapped into a `datapoints.Image`.
if wrapper and isinstance(args[0], cls):
return wrapper(cls, args[0], output) # type: ignore[no-any-return]
return wrapper(cls, args[0], output)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No longer needed without the extra strictness.

Copy link
Member

@NicolasHug NicolasHug left a comment

Choose a reason for hiding this comment

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

Thanks Philip

@pmeier
Copy link
Collaborator Author

pmeier commented Jan 16, 2023

@pmeier pmeier merged commit 8985b59 into pytorch:main Jan 16, 2023
@pmeier pmeier deleted the relax-mypy-prototype branch January 16, 2023 13:05
@github-actions
Copy link

Hey @pmeier!

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 Jan 24, 2023
Reviewed By: YosuaMichael

Differential Revision: D42706912

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