Skip to content

[TOPI] Fix index handling in expand_like operator for axis expansion #18006

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 4 commits into from
Jun 1, 2025

Conversation

jikechao
Copy link
Contributor

@jikechao jikechao commented May 22, 2025

Fix #17947

This PR fixes an index calculation bug in topi.expand_like where incorrect indexing could lead to out-of-bounds access when expanding along specified axes.

If a.shape[src_dim] == 1, we use indice=0 because broadcasting rules require replicating the single value across the expanded dimension, and indexing with 0 ensures correct behavior without bounds violations.

@jikechao
Copy link
Contributor Author

@tvm-bot rerun!

@jikechao
Copy link
Contributor Author

@tvm-bot rerun

@jikechao jikechao marked this pull request as draft May 23, 2025 02:51
@jikechao jikechao marked this pull request as ready for review May 23, 2025 06:38
@jikechao jikechao marked this pull request as draft May 23, 2025 08:12
@jikechao jikechao marked this pull request as ready for review May 26, 2025 05:37
@jikechao
Copy link
Contributor Author

@tvm-bot rerun

@jikechao
Copy link
Contributor Author

jikechao commented Jun 1, 2025

@mshr-h mshr-h merged commit 55b8980 into apache:main Jun 1, 2025
12 of 13 checks passed
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.

[Bug] Meta schedule produce inconsistant inference results
2 participants