Skip to content

Commit b251c29

Browse files
authored
[mlir][tosa] Update PadOp examples in the dialect description (#131919)
* pad_const is now required for tosa.pad op after PR[@129336](#129336) * updated the examples in the dialect description section to reflect this change. Signed-off-by: Jerry Ge <[email protected]>
1 parent 43c21f9 commit b251c29

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

mlir/include/mlir/Dialect/Tosa/IR/TosaOps.td

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1910,15 +1910,17 @@ def Tosa_PadOp : Tosa_InferShapedTypeOp<"pad"> {
19101910
Example:
19111911

19121912
```mlir
1913-
%0 = tosa.const_shape { value = dense<[1, 2, 3, 4]> : tensor<4xindex> } : () -> !tosa.shape<4>
1914-
tosa.pad %arg0, %0 : (tensor<1x2xf32>, !tosa.shape<4>) -> (tensor<4x9xf32>)
1913+
%pad_const = "tosa.const"() {values = dense<3.14> : tensor<1xf32>} : () -> tensor<1xf32>
1914+
%padding = tosa.const_shape {values = dense<[1, 2, 3, 4]> : tensor<4xindex> } : () -> !tosa.shape<4>
1915+
tosa.pad %arg0, %padding, %pad_const: (tensor<1x2xf32>, !tosa.shape<4>, tensor<1xf32>) -> (tensor<4x9xf32>)
19151916
```
19161917

19171918
Example 2:
19181919

19191920
```mlir
1920-
%0 = tosa.const_shape { value = dense<[-1, 2, 3, 4]> : tensor<4xindex> } : () -> !tosa.shape<4>
1921-
tosa.pad %arg0, %0 : (tensor<1x2xf32>, !tosa.shape<4>) -> (tensor<?x9xf32>)
1921+
%pad_const = "tosa.const"() {values = dense<3.14> : tensor<1xf32>} : () -> tensor<1xf32>
1922+
%padding = tosa.const_shape {values = dense<[-1, 2, 3, 4]> : tensor<4xindex> } : () -> !tosa.shape<4>
1923+
tosa.pad %arg0, %padding, %pad_const : (tensor<1x2xf32>, !tosa.shape<4>, tensor<1xf32>) -> (tensor<?x9xf32>)
19221924
```
19231925
}];
19241926

0 commit comments

Comments
 (0)