-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix handling of rank-1 tensors in tosa.reduce_sum
The conversion of `tosa.reduce_sum` to linalg creates a `linalg.generic` op that produces a tensor of rank `input_rank - 1`. This tensor is then expanded back into a tensor of rank `input_rank`. In the case where the tensor being expanded is rank-0, the reassociation map used must be empty. However, the current implementation indexes and modifies the reassociation map independent of the rank of the tensor being expanded, resulting in out-of-bounds indexing when the tensor being expanded is rank-0. This commit adds a guard to the reassociation map indexing. Reviewed By: jpienaar Differential Revision: https://reviews.llvm.org/D135828
- Loading branch information
Showing
2 changed files
with
26 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters