Skip to content
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

fix: Bugfix for align_corners=False- FX interpolate #1561

Merged
merged 1 commit into from
Dec 20, 2022

Conversation

gs-olive
Copy link
Collaborator

@gs-olive gs-olive commented Dec 19, 2022

Description

  • Improve argument checking and validation to match PyTorch interpolate arguments
  • Ensure align_corners=None and align_corners=False have the same behavior

When user explicitly specifies align_corners=False as an argument, it is interpreted as True, since the current check solely checks for the input not being None. The argument check has been updated to check both that the input is not None, but also that it is not False, which is required as per Torch documentation.

Fixes #1558

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • [ x ] My code follows the style guidelines of this project (You can use the linters)
  • [ x ] I have performed a self-review of my own code
  • [ x ] I have commented my code, particularly in hard-to-understand areas and hacks
  • [ x ] I have made corresponding changes to the documentation
  • [ x ] I have added tests to verify my fix or my feature
  • [ x ] New and existing unit tests pass locally with my changes
  • [ x ] I have added the relevant labels to my PR in so that relevant reviewers are notified

- Improve argument checking and validation to match PyTorch interpolate
arguments
- Ensure `align_corners=None` and `align_corners=False` have the same
behavior
- Add regression test case to catch issue and ensure correctness
@gs-olive gs-olive force-pushed the interpolate_fx_args_bugfix branch from 0c317ce to 3672bb5 Compare December 19, 2022 19:28
@gs-olive gs-olive removed the request for review from narendasan December 19, 2022 20:02
@frank-wei
Copy link
Contributor

Thanks for catching up this bug. The test is good for me, too. LGTM!

@gs-olive gs-olive merged commit 0a075f0 into pytorch:master Dec 20, 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.

🐛 [Bug] failed correctness check when using F.interpolate(align_corners=False)
3 participants