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 output size computation for MaxPool2D for ceil_model = true. #3890

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

sahas3
Copy link
Contributor

@sahas3 sahas3 commented Nov 22, 2024

This PR fixes the output size computation as per https://github.com/pytorch/pytorch/blob/d8c14838f164ee02b88b6e37471b71bb0373f865/torch/_meta_registrations.py#L3847

if ceil_mode:
        if (outputSize - 1) * stride >= inputSize + pad_l:
            outputSize -= 1
    return outputSize

@sahas3 sahas3 force-pushed the poolCeil branch 2 times, most recently from 3cbf58a to a79d73a Compare December 2, 2024 15:15
lib/Conversion/TorchToLinalg/Utils.cpp Outdated Show resolved Hide resolved
lib/Conversion/TorchToLinalg/Utils.cpp Outdated Show resolved Hide resolved
Copy link
Collaborator

@sjarus sjarus left a comment

Choose a reason for hiding this comment

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

Looks reasonable for TOSA target. Please check that there are no XPASSes on any TOSA target.

@vivekkhandelwal1
Copy link
Collaborator

@sahas3 Please rebase your PR over the TOM, the CI error should be fixed by that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants