-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[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
Conversation
|
@tvm-bot rerun! |
|
@tvm-bot rerun |
|
@tvm-bot rerun |
|
@jikechao is that issue happens when apply the schedule or generate the schedule? i mean, if i already tuned the schedule, do i need re-tune the schedule after apply the patch, or just re-generate the model library? |
|
@sunzj, you need not re-tune the schedule after applying this patch. Just regenerating the model library is enough. |
|
@sunzj BTW, this patch specifically addresses a special case: the topi.expand_like operator when a.shape[src_dim] == 1. If your model doesn't encounter this edge case, you can safely ignore this patch, as it won't impact your model's behavior. |
Fix #17947
This PR fixes an index calculation bug in
topi.expand_likewhere incorrect indexing could lead to out-of-bounds access when expanding along specified axes.If
a.shape[src_dim] == 1, we useindice=0because broadcasting rules require replicating the single value across the expanded dimension, and indexing with 0 ensures correct behavior without bounds violations.