-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add patterns in ShapeLegalizeToStablehlo for tensor::ExtractOp (#2075)
Add patterns in ShapeLegalizeToStablehlo for tensor::ExtractOp 1. Add support for tensor.Extract, which is lowered to mhlo.slice 2. Support a special case from TF graph: tensor.extract tensor<?xi32> -> i32 arith.index_cast i32 -> index This is lower to: mhlo.slice tensor<?xi32> -> tensor<1xi32> mhlo.reshape tensor<ixi32> -> tensor<i32> unrealized_conversion_cast tensor<i32> -> i32 unrealized_conversion_cast i32 -> tensor<i32> unrealized_conversion_cast tensor<i32> -> index Co-authored-by: Andy Wan <[email protected]>
- Loading branch information
1 parent
2cdab42
commit 7c4ccac
Showing
2 changed files
with
127 additions
and
8 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