Skip to content

Deprecate int as interpolation argument type #5974

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 5 commits into from
May 16, 2022
Merged

Deprecate int as interpolation argument type #5974

merged 5 commits into from
May 16, 2022

Conversation

kylematoba
Copy link
Contributor

@kylematoba kylematoba commented May 9, 2022

@pmeier asked me as part of #5898 to deprecate int as an accepted 'interpolation' argument type.

@datumbox
Copy link
Contributor

datumbox commented May 9, 2022

@kylematoba Could you please provide sufficient information on the PR title/description etc? Thanks!

@kylematoba kylematoba changed the title Requested here https://github.com/pytorch/vision/pull/5898#discussion… Deprecate int as interpolation argument type May 9, 2022
@kylematoba
Copy link
Contributor Author

Yeah, sorry! It's done :).

Copy link
Collaborator

@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.

@kylematoba There are some failing tests: https://app.circleci.com/pipelines/github/pytorch/vision/17435/workflows/8288ec5a-32c3-4d55-bb01-def2c5f2139c. From what I see, they all check the warning message emitted if the functions are called with an int argument. You probably only need to change the expected message there.

@NicolasHug
Copy link
Member

@kylematoba there seem to be a lot of unrelated formatting changes. These can distract the reviewer from what's relevant and they'll add some noise to git blame.

Would you mind reverting these? If you'd like, you could also submit a PR that exclusively addresses these.

Copy link
Collaborator

@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.

Tests seem fine now. Lint CI is unhappy though.

@@ -69,29 +69,12 @@ class TestRotate:
@pytest.mark.parametrize("device", cpu_and_gpu())
@pytest.mark.parametrize("height, width", [(7, 33), (26, IMG_W), (32, IMG_W)])
@pytest.mark.parametrize(
"center",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Although I appreciate this cleanup, it is unrelated to the PR. Could you please revert this? We will happily accept a follow-up PR with the changes.

@kylematoba
Copy link
Contributor Author

Sorry about the mis-formatting. As far as I can see, it's undone and I think that the test failures are not related to my changes.

Copy link
Collaborator

@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, thanks @kylematoba!

@kylematoba
Copy link
Contributor Author

cool, so can we merge this?

@pmeier pmeier requested a review from datumbox May 16, 2022 14:40
For backward compatibility integer values (e.g. ``PIL.Image[.Resampling].NEAREST``) are still acceptable.

For backward compatibility integer values (e.g. ``PIL.Image[.Resampling].NEAREST``) are still accepted,
but deprecated since 0.13 and will be removed in 0.15. Please use InterpolationMode enum.
Copy link
Contributor

@datumbox datumbox May 16, 2022

Choose a reason for hiding this comment

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

I would be in favour of removing from the documentation the deprecation notes and leave them only as warnings. This will help us keep clean our docs and promote the best practices/options. I would leave the warnings as-is to inform those who already use it to change.

What I describe above is exactly what we currently do for Multi-weight API. The documentation no longer mentions anything about pretrained. Only about weights.

@NicolasHug thoughts?

Copy link
Member

@NicolasHug NicolasHug May 16, 2022

Choose a reason for hiding this comment

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

The pretrained case is a bit special because we actually removed it plainly, while keeping BC as much as possible. But in general I'm in favour of documenting deprecations in the docstrings as well

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!

@datumbox datumbox merged commit 44252c8 into pytorch:main May 16, 2022
@github-actions
Copy link

Hey @datumbox!

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 Jun 1, 2022
Summary:
* Requested here #5898 (comment).

* Fix tests

* ufmt, not black

Reviewed By: NicolasHug

Differential Revision: D36760927

fbshipit-source-id: 8ed8c6eaf32928f71ba6d4b3cf23a4b84f310d81

Co-authored-by: Philip Meier <[email protected]>
Co-authored-by: Vasilis Vryniotis <[email protected]>
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.

5 participants