diff --git a/mlir/include/mlir/Dialect/Tosa/IR/TosaOps.td b/mlir/include/mlir/Dialect/Tosa/IR/TosaOps.td --- a/mlir/include/mlir/Dialect/Tosa/IR/TosaOps.td +++ b/mlir/include/mlir/Dialect/Tosa/IR/TosaOps.td @@ -1516,7 +1516,23 @@ let summary = "Pads a tensor with value specified."; let description = [{ - Pads a tensor along borders of each dimension with pad_value. + The `tosa.pad` operation pads a tensor along borders of each dimension with + `pad_const` (defaults to zero), given a padding configuration `padding` + specifying low and high values along the dimensions. + + Example: + + ```mlir + %0 = arith.constant dense<[[1, 2], [3, 4]]> : tensor<2x2xi32> + "tosa.pad"(%arg0, %0) : (tensor<1x2xf32>, tensor<2x2xi32>) -> (tensor<4x9xf32>) + ``` + + Example 2: + + ```mlir + %0 = arith.constant dense<[[-1, 2], [3, 4]]> : tensor<2x2xi32> + "tosa.pad"(%arg0, %0) : (tensor<1x2xf32>, tensor<2x2xi32>) -> (tensor) + ``` }]; let arguments = (ins