forked from OSchip/llvm-project
[mlir] Add SingleBlockImplicitTerminator<"tensor::YieldOp"> to PadOp.
This commit is contained in:
parent
26544b98f7
commit
4041354b4c
|
@ -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] {
|
||||
|
|
Loading…
Reference in New Issue