You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given the following example:
```
func.func @pack_with_unit_outer_dims_and_non_adjacent_inner(%arg0: tensor<3x1x4xf32>, %arg1: tensor<1x1x1x4x3xf32>) -> tensor<1x1x1x4x3xf32> {
%pack = linalg.pack %arg0 outer_dims_perm = [1, 2, 0] inner_dims_pos = [2, 0] inner_tiles = [4, 3] into %arg1 : tensor<3x1x4xf32> -> tensor<1x1x1x4x3xf32>
return %pack : tensor<1x1x1x4x3xf32>
}
```
We would up until now creating an invalid transpose. That is because we would use the `getDimAndTileMapping()` function of the packOp which tranposes the tile dimensions to match based on the given `inner_dims_pos` value.
Here in the above example we have `inner_dims_pos` of `[2, 0]` meaning from the source tensors the indices 2 and 0 must be the `inner_tiles`. This property is not required for calculating the tile sizes as the destination tensor shape will be simply `[1x1x1x4x3]`. The inner dimensions positions are only required for calculating the tranpose. With this we can simplify the pattern.
0 commit comments