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

[Task] : Handle CHW input for avgpool2d. #4042

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sahas3
Copy link
Contributor

@sahas3 sahas3 commented Feb 24, 2025

This PR fixes two issues:

  1. Avg(Max)Pool2d allows (C, H, W) as input which causes a failure when creating tosa.avg_pool2d or tosa.max_pool2d as those ops expects 4D (N, H, W, C) tensor. Fix is to add a N=1 dimension before creating the tosa ops.
  2. Avg(Max)Pool2d also allows kernel/stride to be specified as a tuple of single int, in which case the value is repeated for both H and W dims. This is currently not handled as well causing a segv when trying to access kernel[1]/stride[1]. Fix is to expand kernel/stride to be size 2 by repeating the first element.

@sahas3 sahas3 requested a review from sjarus February 24, 2025 01:53
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.

1 participant