-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix BroadcastInDimOps linalg lowering with compatible dim=1
For the case of simple broadcast check that we don't have to extend dimentions, so skip convertion to BroadcastOp when only one of them is 1. Error before: test.mlir:5:8: error: 'linalg.broadcast' op input dim 1 should match init dim 2. input: 1, init: 5 %0 = stablehlo.broadcast_in_dim %arg, dims = [1, 2, 3] : (tensor<3x1x1xf32>) -> tensor<1x3x5x7xf32> ^ test.mlir:5:8: note: see current operation: %1 = "linalg.broadcast"(%arg0, %0) <{dimensions = array<i64: 0>}> ({ ^bb0(%arg1: f32, %arg2: f32): "linalg.yield"(%arg1) : (f32) -> () }) : (tensor<3x1x1xf32>, tensor<1x3x5x7xf32>) -> tensor<1x3x5x7xf32>
- Loading branch information
1 parent
8c7d87b
commit 6bc2855
Showing
2 changed files
with
48 additions
and
4 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