Commit 4041354b authored by Alexander Belyaev's avatar Alexander Belyaev
Browse files

[mlir] Add SingleBlockImplicitTerminator<"tensor::YieldOp"> to PadOp.

parent 26544b98
......@@ -782,13 +782,14 @@ def Tensor_CollapseShapeOp : Tensor_ReassociativeReshapeOp<"collapse_shape"> {
// PadOp
//===----------------------------------------------------------------------===//
def Tensor_PadOp : Tensor_Op<"pad", [AttrSizedOperandSegments, NoSideEffect]> {
def Tensor_PadOp : Tensor_Op<"pad", [AttrSizedOperandSegments, NoSideEffect,
SingleBlockImplicitTerminator<"mlir::tensor::YieldOp">]> {
let summary = "tensor pad operation";
let description = [{
`tensor.pad` is an operation that pads the `source` tensor
with given `low` and `high` padding config.
The PadTensor operation supports the following arguments:
The PadOp operation supports the following arguments:
* source: the "base" tensor on which to pad.
* low: A list contains the padding along the start of each
......
......@@ -343,15 +343,6 @@ func @pad_number_of_block_args(%arg0: tensor<?x4xi32>, %arg1: i32) -> tensor<?x9
// -----
func @pad_no_block(%arg0: tensor<?x4xi32>, %arg1: i32) -> tensor<?x9xi32> {
// expected-error @+1 {{op region #0 ('region') failed to verify constraint: region with 1 blocks}}
%0 = tensor.pad %arg0 low[1, 2] high[2, 3] {
} : tensor<?x4xi32> to tensor<?x9xi32>
return %0 : tensor<?x9xi32>
}
// -----
func @pad_block_args(%arg0: tensor<?x4xi32>, %arg1: i32) -> tensor<?x9xi32> {
// expected-error @+1 {{op expected block argument 1 to be an index}}
%0 = tensor.pad %arg0 low[1, 2] high[2, 3] {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment