Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -579,13 +579,23 @@ class RegionBuilderHelper {
return arith::MinSIOp::create(builder, arg0.getLoc(), arg0, arg1);
case BinaryFn::max_unsigned:
assert(!allComplex);
if (allFloatingPoint)
return arith::MaximumFOp::create(builder, arg0.getLoc(), arg0, arg1);
if (!allInteger || allBool) {
if (emitError) {
emitError() << "unsupported operation: unsigned max not on uint";
return nullptr;
}
llvm_unreachable("unsupported operation: unsigned max not on uint");
}
Comment on lines +582 to +588
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Men-cotton - thanks for taking this up.
Although this addresses the immediate issue of linalg.*_(max|min)_unsigned_* - a better solution might be to indeed fix :-

def _binary_max_unsigned(self, lhs: Value, rhs: Value) -> Value:
if _is_floating_point_type(lhs.type):
return arith.MaximumFOp(lhs, rhs).result
if _is_integer_type(lhs.type) or _is_index_type(lhs.type):
return arith.MaxUIOp(lhs, rhs).result
raise NotImplementedError("Unsupported 'max_unsigned' operands: {lhs}, {rhs}")

Because that'd ensure that in future some other op implementing a (max|min)_unsigned also doesn't warrant a similar fix in their verifier as the one above.

I also see something similar already done in this file for a non-Convolution op : linalg.div_unsigned :-

case BinaryFn::div_unsigned:
if (!allInteger || allBool) {
if (emitError) {
emitError() << "unsupported operation: unsigned div not on uint";
return nullptr;
}
llvm_unreachable("unsupported operation: unsigned div not on uint");
}

Again, these are just my opinion - I'll let @banach-space take a closer look. :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not really familiar with OPDSL, but in ideal world we should be able to write verification tests and add them in https://github.com/llvm/llvm-project/blob/main/mlir/test/Dialect/Linalg/invalid.mlir - could you try @Men-cotton ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @banach-space , thank you for the suggestion.
I actually already added a verification test in mlir/test/Dialect/Linalg/named-ops-fail.mlir. If you prefer invalid.mlir or find the current test insufficient, please let me know.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@banach-space @Abhishek-Varma
I've moved the verification tests from named-ops-fail.mlir to invalid.mlir. This allows us to use -verify-diagnostics for more precise error location checking, rather than relying on FileCheck.
Please take a look. Thanks!

return arith::MaxUIOp::create(builder, arg0.getLoc(), arg0, arg1);
case BinaryFn::min_unsigned:
assert(!allComplex);
if (allFloatingPoint)
return arith::MinimumFOp::create(builder, arg0.getLoc(), arg0, arg1);
if (!allInteger || allBool) {
if (emitError) {
emitError() << "unsupported operation: unsigned min not on uint";
return nullptr;
}
llvm_unreachable("unsupported operation: unsigned min not on uint");
}
return arith::MinUIOp::create(builder, arg0.getLoc(), arg0, arg1);
case BinaryFn::powf:
assert(allFloatingPoint);
Expand Down
18 changes: 12 additions & 6 deletions mlir/python/mlir/dialects/linalg/opdsl/lang/emitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,9 +532,9 @@ def _binary_max_signed(self, lhs: Value, rhs: Value) -> Value:
raise NotImplementedError("Unsupported 'max' operands: {lhs}, {rhs}")

def _binary_max_unsigned(self, lhs: Value, rhs: Value) -> Value:
if _is_floating_point_type(lhs.type):
return arith.MaximumFOp(lhs, rhs).result
if _is_integer_type(lhs.type) or _is_index_type(lhs.type):
if (
_is_integer_type(lhs.type) and not _is_bool_type(lhs.type)
) or _is_index_type(lhs.type):
return arith.MaxUIOp(lhs, rhs).result
raise NotImplementedError("Unsupported 'max_unsigned' operands: {lhs}, {rhs}")

Expand All @@ -546,9 +546,9 @@ def _binary_min_signed(self, lhs: Value, rhs: Value) -> Value:
raise NotImplementedError("Unsupported 'min' operands: {lhs}, {rhs}")

def _binary_min_unsigned(self, lhs: Value, rhs: Value) -> Value:
if _is_floating_point_type(lhs.type):
return arith.MinimumFOp(lhs, rhs).result
if _is_integer_type(lhs.type) or _is_index_type(lhs.type):
if (
_is_integer_type(lhs.type) and not _is_bool_type(lhs.type)
) or _is_index_type(lhs.type):
return arith.MinUIOp(lhs, rhs).result
raise NotImplementedError("Unsupported 'min_unsigned' operands: {lhs}, {rhs}")

Expand Down Expand Up @@ -634,6 +634,12 @@ def _is_index_type(t: Type) -> bool:
return IndexType.isinstance(t)


def _is_bool_type(t: Type) -> bool:
if not IntegerType.isinstance(t):
return False
return IntegerType(t).width == 1


def _get_floating_point_width(t: Type) -> int:
# TODO: Create a FloatType in the Python API and implement the switch
# there.
Expand Down
13 changes: 0 additions & 13 deletions mlir/test/Dialect/Linalg/convolution/roundtrip-convolution.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -481,19 +481,6 @@ func.func @pooling_nhwc_min_unsigned_integer(%input: tensor<?x?x?x?xi32>, %filte

// -----

func.func @pooling_nhwc_min_unsigned_float(%input: tensor<?x?x?x?xf32>, %filter: tensor<?x?xf32>, %output: tensor<?x?x?x?xf32>) -> tensor<?x?x?x?xf32> {
%0 = linalg.pooling_nhwc_min_unsigned
{dilations = dense<1> : tensor<2xi64>, strides = dense<1> : tensor<2xi64>}
ins (%input, %filter: tensor<?x?x?x?xf32>, tensor<?x?xf32>)
outs (%output: tensor<?x?x?x?xf32>) -> tensor<?x?x?x?xf32>
return %0 : tensor<?x?x?x?xf32>
}
// CHECK: @pooling_nhwc_min_unsigned_float
// CHECK: linalg.pooling_nhwc_min
// CHECK-SAME: dilations = dense<1> : tensor<2xi64>, strides = dense<1> : tensor<2xi64>

// -----

func.func @pooling_nchw_sum(%input: tensor<?x?x?x?xf32>, %filter: tensor<?x?xf32>, %output: tensor<?x?x?x?xf32>) -> tensor<?x?x?x?xf32> {
%0 = linalg.pooling_nchw_sum
{dilations = dense<2> : tensor<2xi64>, strides = dense<3> : tensor<2xi64>}
Expand Down
119 changes: 119 additions & 0 deletions mlir/test/Dialect/Linalg/invalid.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -1931,6 +1931,125 @@ func.func @reduce_non_operation_name(%arg0: tensor<4xf32>, %arg1: tensor<f32>) -

// -----

//===----------------------------------------------------------------------===//
// linalg.pooling_nhwc_*
//===----------------------------------------------------------------------===//

func.func @pooling_nhwc_max_unsigned_float_type(
%input: tensor<1x4x4x1xf32>,
%filter: tensor<2x2xf32>,
%init_val: tensor<1x2x2x1xf32>) -> tensor<1x2x2x1xf32> {
// expected-error @+1 {{unsupported operation: unsigned max not on uint}}
%0 = linalg.pooling_nhwc_max_unsigned {dilations = dense<1> : tensor<2xi64>,
strides = dense<1> : tensor<2xi64>}
ins (%input, %filter: tensor<1x4x4x1xf32>, tensor<2x2xf32>)
outs (%init_val: tensor<1x2x2x1xf32>) -> tensor<1x2x2x1xf32>
return %0 : tensor<1x2x2x1xf32>
}

// -----

func.func @pooling_nhwc_max_unsigned_i1(
%input: tensor<1x4x4x1xi1>,
%filter: tensor<2x2xi1>,
%init_val: tensor<1x2x2x1xi1>) -> tensor<1x2x2x1xi1> {
// expected-error @+1 {{unsupported operation: unsigned max not on uint}}
%0 = linalg.pooling_nhwc_max_unsigned {dilations = dense<1> : tensor<2xi64>,
strides = dense<1> : tensor<2xi64>}
ins (%input, %filter: tensor<1x4x4x1xi1>, tensor<2x2xi1>)
outs (%init_val: tensor<1x2x2x1xi1>) -> tensor<1x2x2x1xi1>
return %0 : tensor<1x2x2x1xi1>
}

// -----

func.func @pooling_nhwc_min_unsigned_float_type(
%input: tensor<1x4x4x1xf32>,
%filter: tensor<2x2xf32>,
%init_val: tensor<1x2x2x1xf32>) -> tensor<1x2x2x1xf32> {
// expected-error @+1 {{unsupported operation: unsigned min not on uint}}
%0 = linalg.pooling_nhwc_min_unsigned {dilations = dense<1> : tensor<2xi64>,
strides = dense<1> : tensor<2xi64>}
ins (%input, %filter: tensor<1x4x4x1xf32>, tensor<2x2xf32>)
outs (%init_val: tensor<1x2x2x1xf32>) -> tensor<1x2x2x1xf32>
return %0 : tensor<1x2x2x1xf32>
}

// -----

func.func @pooling_nhwc_min_unsigned_i1(
%input: tensor<1x4x4x1xi1>,
%filter: tensor<2x2xi1>,
%init_val: tensor<1x2x2x1xi1>) -> tensor<1x2x2x1xi1> {
// expected-error @+1 {{unsupported operation: unsigned min not on uint}}
%0 = linalg.pooling_nhwc_min_unsigned {dilations = dense<1> : tensor<2xi64>,
strides = dense<1> : tensor<2xi64>}
ins (%input, %filter: tensor<1x4x4x1xi1>, tensor<2x2xi1>)
outs (%init_val: tensor<1x2x2x1xi1>) -> tensor<1x2x2x1xi1>
return %0 : tensor<1x2x2x1xi1>
}

// -----

//===----------------------------------------------------------------------===//
// linalg.pooling_nwc_*
//===----------------------------------------------------------------------===//

func.func @pooling_nwc_max_unsigned_float_type(
%input: tensor<1x4x1xf32>,
%filter: tensor<2xf32>,
%init_val: tensor<1x2x1xf32>) -> tensor<1x2x1xf32> {
// expected-error @+1 {{unsupported operation: unsigned max not on uint}}
%0 = linalg.pooling_nwc_max_unsigned {dilations = dense<1> : tensor<1xi64>,
strides = dense<1> : tensor<1xi64>}
ins (%input, %filter: tensor<1x4x1xf32>, tensor<2xf32>)
outs (%init_val: tensor<1x2x1xf32>) -> tensor<1x2x1xf32>
return %0 : tensor<1x2x1xf32>
}

// -----

func.func @pooling_nwc_max_unsigned_i1(
%input: tensor<1x4x1xi1>,
%filter: tensor<2xi1>,
%init_val: tensor<1x2x1xi1>) -> tensor<1x2x1xi1> {
// expected-error @+1 {{unsupported operation: unsigned max not on uint}}
%0 = linalg.pooling_nwc_max_unsigned {dilations = dense<1> : tensor<1xi64>,
strides = dense<1> : tensor<1xi64>}
ins (%input, %filter: tensor<1x4x1xi1>, tensor<2xi1>)
outs (%init_val: tensor<1x2x1xi1>) -> tensor<1x2x1xi1>
return %0 : tensor<1x2x1xi1>
}

// -----

func.func @pooling_nwc_min_unsigned_float_type(
%input: tensor<1x4x1xf32>,
%filter: tensor<2xf32>,
%init_val: tensor<1x2x1xf32>) -> tensor<1x2x1xf32> {
// expected-error @+1 {{unsupported operation: unsigned min not on uint}}
%0 = linalg.pooling_nwc_min_unsigned {dilations = dense<1> : tensor<1xi64>,
strides = dense<1> : tensor<1xi64>}
ins (%input, %filter: tensor<1x4x1xf32>, tensor<2xf32>)
outs (%init_val: tensor<1x2x1xf32>) -> tensor<1x2x1xf32>
return %0 : tensor<1x2x1xf32>
}

// -----

func.func @pooling_nwc_min_unsigned_i1(
%input: tensor<1x4x1xi1>,
%filter: tensor<2xi1>,
%init_val: tensor<1x2x1xi1>) -> tensor<1x2x1xi1> {
// expected-error @+1 {{unsupported operation: unsigned min not on uint}}
%0 = linalg.pooling_nwc_min_unsigned {dilations = dense<1> : tensor<1xi64>,
strides = dense<1> : tensor<1xi64>}
ins (%input, %filter: tensor<1x4x1xi1>, tensor<2xi1>)
outs (%init_val: tensor<1x2x1xi1>) -> tensor<1x2x1xi1>
return %0 : tensor<1x2x1xi1>
}

// -----

//===----------------------------------------------------------------------===//
// Tests for generic infrastructure for named Ops. The actual Ops used are
Expand Down
1 change: 0 additions & 1 deletion mlir/test/Dialect/Linalg/named-ops-fail.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -349,4 +349,3 @@ func.func @select_wrong_condition_type(%arg0: memref<4x8x16xf32>, %arg1: memref<
linalg.select ins(%arg0, %arg1, %arg2 : memref<4x8x16xf32>, memref<4x8x16xf32>, memref<4x8x16xf32>) outs(%arg3: memref<4x8x16xf32>)
return
}

72 changes: 72 additions & 0 deletions mlir/test/Dialect/Linalg/named-ops.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,42 @@ func.func @pooling_nhwc_max_tensor(%input: tensor<1x4x4x1xf32>) -> tensor<1x2x2x
return %res : tensor<1x2x2x1xf32>
}

// -----

// CHECK-LABEL: func @pooling_nhwc_max_unsigned_i32
// CHECK: %{{.+}} = linalg.pooling_nhwc_max_unsigned
// CHECK-SAME: ins(%{{.+}}, %{{.+}} : tensor<1x4x4x1xi32>, tensor<3x3xi32>)
// CHECK-SAME: outs(%{{.+}} : tensor<1x2x2x1xi32>) -> tensor<1x2x2x1xi32>
func.func @pooling_nhwc_max_unsigned_i32(%input: tensor<1x4x4x1xi32>) -> tensor<1x2x2x1xi32> {
%fake = tensor.empty() : tensor<3x3xi32>
%init = tensor.empty() : tensor<1x2x2x1xi32>
%cst = arith.constant 0 : i32
%fill = linalg.fill ins(%cst : i32) outs(%init : tensor<1x2x2x1xi32>) -> tensor<1x2x2x1xi32>
%res = linalg.pooling_nhwc_max_unsigned {dilations = dense<1> : tensor<2xi64>, strides = dense<1> : tensor<2xi64>}
ins(%input, %fake: tensor<1x4x4x1xi32>, tensor<3x3xi32>)
outs(%fill: tensor<1x2x2x1xi32>) -> tensor<1x2x2x1xi32>
return %res : tensor<1x2x2x1xi32>
}

// -----

// CHECK-LABEL: func @pooling_nwc_max_unsigned_i32
// CHECK: %{{.+}} = linalg.pooling_nwc_max_unsigned
// CHECK-SAME: dilations = dense<1> : tensor<1xi64>
// CHECK-SAME: strides = dense<1> : tensor<1xi64>
// CHECK-SAME: ins(%{{.+}}, %{{.+}} : tensor<1x4x1xi32>, tensor<3xi32>)
// CHECK-SAME: outs(%{{.+}} : tensor<1x2x1xi32>) -> tensor<1x2x1xi32>
func.func @pooling_nwc_max_unsigned_i32(%input: tensor<1x4x1xi32>) -> tensor<1x2x1xi32> {
%fake = tensor.empty() : tensor<3xi32>
%init = tensor.empty() : tensor<1x2x1xi32>
%cst = arith.constant 0 : i32
%fill = linalg.fill ins(%cst : i32) outs(%init : tensor<1x2x1xi32>) -> tensor<1x2x1xi32>
%res = linalg.pooling_nwc_max_unsigned {dilations = dense<1> : tensor<1xi64>, strides = dense<1> : tensor<1xi64>}
ins(%input, %fake: tensor<1x4x1xi32>, tensor<3xi32>)
outs(%fill: tensor<1x2x1xi32>) -> tensor<1x2x1xi32>
return %res : tensor<1x2x1xi32>
}

// -----
// CHECK-LABEL: func @pooling_nwc_max_tensor
// CHECK: %{{.+}} = linalg.pooling_nwc_max
Expand Down Expand Up @@ -1017,6 +1053,42 @@ func.func @pooling_nhwc_min_tensor(%input: tensor<1x4x4x1xf32>) -> tensor<1x2x2x

// -----

// CHECK-LABEL: func @pooling_nhwc_min_unsigned_i32
// CHECK: %{{.+}} = linalg.pooling_nhwc_min_unsigned
// CHECK-SAME: ins(%{{.+}}, %{{.+}} : tensor<1x4x4x1xi32>, tensor<3x3xi32>)
// CHECK-SAME: outs(%{{.+}} : tensor<1x2x2x1xi32>) -> tensor<1x2x2x1xi32>
func.func @pooling_nhwc_min_unsigned_i32(%input: tensor<1x4x4x1xi32>) -> tensor<1x2x2x1xi32> {
%fake = tensor.empty() : tensor<3x3xi32>
%init = tensor.empty() : tensor<1x2x2x1xi32>
%cst = arith.constant 0 : i32
%fill = linalg.fill ins(%cst : i32) outs(%init : tensor<1x2x2x1xi32>) -> tensor<1x2x2x1xi32>
%res = linalg.pooling_nhwc_min_unsigned {dilations = dense<1> : tensor<2xi64>, strides = dense<1> : tensor<2xi64>}
ins(%input, %fake: tensor<1x4x4x1xi32>, tensor<3x3xi32>)
outs(%fill: tensor<1x2x2x1xi32>) -> tensor<1x2x2x1xi32>
return %res : tensor<1x2x2x1xi32>
}

// -----

// CHECK-LABEL: func @pooling_nwc_min_unsigned_i32
// CHECK: %{{.+}} = linalg.pooling_nwc_min_unsigned
// CHECK-SAME: dilations = dense<1> : tensor<1xi64>
// CHECK-SAME: strides = dense<1> : tensor<1xi64>
// CHECK-SAME: ins(%{{.+}}, %{{.+}} : tensor<1x4x1xi32>, tensor<3xi32>)
// CHECK-SAME: outs(%{{.+}} : tensor<1x2x1xi32>) -> tensor<1x2x1xi32>
func.func @pooling_nwc_min_unsigned_i32(%input: tensor<1x4x1xi32>) -> tensor<1x2x1xi32> {
%fake = tensor.empty() : tensor<3xi32>
%init = tensor.empty() : tensor<1x2x1xi32>
%cst = arith.constant 0 : i32
%fill = linalg.fill ins(%cst : i32) outs(%init : tensor<1x2x1xi32>) -> tensor<1x2x1xi32>
%res = linalg.pooling_nwc_min_unsigned {dilations = dense<1> : tensor<1xi64>, strides = dense<1> : tensor<1xi64>}
ins(%input, %fake: tensor<1x4x1xi32>, tensor<3xi32>)
outs(%fill: tensor<1x2x1xi32>) -> tensor<1x2x1xi32>
return %res : tensor<1x2x1xi32>
}

// -----

// CHECK-LABEL: func @pooling_nwc_min_tensor
// CHECK: %{{.+}} = linalg.pooling_nwc_min
// CHECK-SAME: dilations = dense<1> : tensor<1xi64>
Expand Down
28 changes: 14 additions & 14 deletions mlir/test/Dialect/Linalg/transform-op-decompose.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -131,21 +131,21 @@ func.func @pooling_nhwc_max(%input: tensor<?x1x?x?xf32>, %filter: tensor<1x?xf32
}

// CHECK-LABEL: @pooling_nhwc_max_unsigned
// CHECK-SAME: %[[ARG0:.+]]: tensor<?x1x?x?xf32>,
// CHECK-SAME: %[[ARG1:.+]]: tensor<1x?xf32>
// CHECK-SAME: %[[ARG2:.+]]: tensor<?x1x?x?xf32>
func.func @pooling_nhwc_max_unsigned(%input: tensor<?x1x?x?xf32>, %filter: tensor<1x?xf32>, %init: tensor<?x1x?x?xf32>) -> tensor<?x1x?x?xf32> {
// CHECK-SAME: %[[ARG0:.+]]: tensor<?x1x?x?xi32>,
// CHECK-SAME: %[[ARG1:.+]]: tensor<1x?xi32>
// CHECK-SAME: %[[ARG2:.+]]: tensor<?x1x?x?xi32>
func.func @pooling_nhwc_max_unsigned(%input: tensor<?x1x?x?xi32>, %filter: tensor<1x?xi32>, %init: tensor<?x1x?x?xi32>) -> tensor<?x1x?x?xi32> {
// CHECK: %[[SLICE0:.+]] = tensor.extract_slice %[[ARG0]]
// CHECK: %[[SLICE1:.+]] = tensor.extract_slice %[[ARG1]]
// CHECK: %[[SLICE2:.+]] = tensor.extract_slice %[[ARG2]]
// CHECK: %[[SLICERES:.+]] = linalg.pooling_nwc_max_unsigned
// CHECK: %[[RES:.+]] = tensor.insert_slice %[[SLICERES]] into %[[ARG2]]
%0 = linalg.pooling_nhwc_max_unsigned {dilations = dense<1> : tensor<2xi64>,
strides = dense<1> : tensor<2xi64>}
ins (%input, %filter: tensor<?x1x?x?xf32>, tensor<1x?xf32>)
outs (%init: tensor<?x1x?x?xf32>) -> tensor<?x1x?x?xf32>
ins (%input, %filter: tensor<?x1x?x?xi32>, tensor<1x?xi32>)
outs (%init: tensor<?x1x?x?xi32>) -> tensor<?x1x?x?xi32>
// CHECK: return %[[RES]]
return %0 : tensor<?x1x?x?xf32>
return %0 : tensor<?x1x?x?xi32>
}

// CHECK-LABEL: @pooling_nhwc_min
Expand All @@ -167,21 +167,21 @@ func.func @pooling_nhwc_min(%input: tensor<?x1x?x?xf32>, %filter: tensor<1x?xf32
}

// CHECK-LABEL: @pooling_nhwc_min_unsigned
// CHECK-SAME: %[[ARG0:.+]]: tensor<?x1x?x?xf32>,
// CHECK-SAME: %[[ARG1:.+]]: tensor<1x?xf32>
// CHECK-SAME: %[[ARG2:.+]]: tensor<?x1x?x?xf32>
func.func @pooling_nhwc_min_unsigned(%input: tensor<?x1x?x?xf32>, %filter: tensor<1x?xf32>, %init: tensor<?x1x?x?xf32>) -> tensor<?x1x?x?xf32> {
// CHECK-SAME: %[[ARG0:.+]]: tensor<?x1x?x?xi32>,
// CHECK-SAME: %[[ARG1:.+]]: tensor<1x?xi32>
// CHECK-SAME: %[[ARG2:.+]]: tensor<?x1x?x?xi32>
func.func @pooling_nhwc_min_unsigned(%input: tensor<?x1x?x?xi32>, %filter: tensor<1x?xi32>, %init: tensor<?x1x?x?xi32>) -> tensor<?x1x?x?xi32> {
// CHECK: %[[SLICE0:.+]] = tensor.extract_slice %[[ARG0]]
// CHECK: %[[SLICE1:.+]] = tensor.extract_slice %[[ARG1]]
// CHECK: %[[SLICE2:.+]] = tensor.extract_slice %[[ARG2]]
// CHECK: %[[SLICERES:.+]] = linalg.pooling_nwc_min_unsigned
// CHECK: %[[RES:.+]] = tensor.insert_slice %[[SLICERES]] into %[[ARG2]]
%0 = linalg.pooling_nhwc_min_unsigned {dilations = dense<1> : tensor<2xi64>,
strides = dense<1> : tensor<2xi64>}
ins (%input, %filter: tensor<?x1x?x?xf32>, tensor<1x?xf32>)
outs (%init: tensor<?x1x?x?xf32>) -> tensor<?x1x?x?xf32>
ins (%input, %filter: tensor<?x1x?x?xi32>, tensor<1x?xi32>)
outs (%init: tensor<?x1x?x?xi32>) -> tensor<?x1x?x?xi32>
// CHECK: return %[[RES]]
return %0 : tensor<?x1x?x?xf32>
return %0 : tensor<?x1x?x?xi32>
}

// CHECK-LABEL: @pooling_nchw_max
Expand Down
Loading