Register tf.math.minimum for all integer types.
tf.math.maximum was already registered for all integer types.
Note that this does not add any new kernels. However, it allows the use
of tf.math.minimum at all integer types under `tf.function(jit_compile=True)`.
PiperOrigin-RevId: 374583761
Change-Id: Id7f1eaec109752850f35f206bb3fcbab1d19c0ac
diff --git a/tensorflow/compiler/mlir/tensorflow/ir/tf_generated_ops.td b/tensorflow/compiler/mlir/tensorflow/ir/tf_generated_ops.td
index 16a5744..c9a15e4 100644
--- a/tensorflow/compiler/mlir/tensorflow/ir/tf_generated_ops.td
+++ b/tensorflow/compiler/mlir/tensorflow/ir/tf_generated_ops.td
@@ -9007,12 +9007,12 @@
}];
let arguments = (ins
- TensorOf<[TF_Bfloat16, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Uint8]>:$x,
- TensorOf<[TF_Bfloat16, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Uint8]>:$y
+ TF_IntOrFpTensor:$x,
+ TF_IntOrFpTensor:$y
);
let results = (outs
- TensorOf<[TF_Bfloat16, TF_Float16, TF_Float32, TF_Float64, TF_Int16, TF_Int32, TF_Int64, TF_Uint8]>:$z
+ TF_IntOrFpTensor:$z
);
TF_DerivedOperandTypeAttr T = TF_DerivedOperandTypeAttr<0>;
diff --git a/tensorflow/core/ops/math_ops.cc b/tensorflow/core/ops/math_ops.cc
index 0ac8543..5691049 100644
--- a/tensorflow/core/ops/math_ops.cc
+++ b/tensorflow/core/ops/math_ops.cc
@@ -560,8 +560,8 @@
.Input("y: T")
.Output("z: T")
.Attr(
- "T: {bfloat16, half, float, double, int8, int16, int32, int64, "
- "uint8, uint16, uint32, uint64}")
+ "T: {bfloat16, half, float, double, int8, uint8, int16, uint16, "
+ "int32, uint32, int64, uint64}")
.SetShapeFn(shape_inference::BroadcastBinaryOpShapeFn);
// Note: This op is not commutative w.r.t. to all its inputs.
@@ -585,7 +585,9 @@
.Input("x: T")
.Input("y: T")
.Output("z: T")
- .Attr("T: {bfloat16, half, float, double, uint8, int16, int32, int64}")
+ .Attr(
+ "T: {bfloat16, half, float, double, int8, uint8, int16, uint16, "
+ "int32, uint32, int64, uint64}")
.SetShapeFn(shape_inference::BroadcastBinaryOpShapeFn);
REGISTER_OP("Mod")