Internal change
PiperOrigin-RevId: 306921449 Change-Id: I4e2c6f31d38dcb821ace207c12a17232813e9fa5
This commit is contained in:
parent
1e5d6adc00
commit
339eab07e8
@ -19,7 +19,7 @@ limitations under the License.
|
|||||||
|
|
||||||
namespace tensorflow {
|
namespace tensorflow {
|
||||||
namespace functor {
|
namespace functor {
|
||||||
DEFINE_BINARY5(maximum, Eigen::half, float, double, int16, int64);
|
DEFINE_BINARY4(maximum, Eigen::half, float, double, int64);
|
||||||
} // namespace functor
|
} // namespace functor
|
||||||
} // namespace tensorflow
|
} // namespace tensorflow
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ limitations under the License.
|
|||||||
|
|
||||||
namespace tensorflow {
|
namespace tensorflow {
|
||||||
namespace functor {
|
namespace functor {
|
||||||
DEFINE_BINARY5(minimum, Eigen::half, float, double, int16, int64);
|
DEFINE_BINARY4(minimum, Eigen::half, float, double, int64);
|
||||||
} // namespace functor
|
} // namespace functor
|
||||||
} // namespace tensorflow
|
} // namespace tensorflow
|
||||||
|
|
||||||
|
@ -16,11 +16,11 @@ limitations under the License.
|
|||||||
#include "tensorflow/core/kernels/cwise_ops_common.h"
|
#include "tensorflow/core/kernels/cwise_ops_common.h"
|
||||||
|
|
||||||
namespace tensorflow {
|
namespace tensorflow {
|
||||||
REGISTER7(BinaryOp, CPU, "Maximum", functor::maximum, float, Eigen::half,
|
REGISTER6(BinaryOp, CPU, "Maximum", functor::maximum, float, Eigen::half,
|
||||||
bfloat16, double, int16, int32, int64);
|
bfloat16, double, int32, int64);
|
||||||
#if GOOGLE_CUDA || TENSORFLOW_USE_ROCM
|
#if GOOGLE_CUDA || TENSORFLOW_USE_ROCM
|
||||||
REGISTER5(BinaryOp, GPU, "Maximum", functor::maximum, float, Eigen::half,
|
REGISTER4(BinaryOp, GPU, "Maximum", functor::maximum, float, Eigen::half,
|
||||||
double, int16, int64);
|
double, int64);
|
||||||
|
|
||||||
// A special GPU kernel for int32.
|
// A special GPU kernel for int32.
|
||||||
// TODO(b/25387198): Also enable int32 in device memory. This kernel
|
// TODO(b/25387198): Also enable int32 in device memory. This kernel
|
||||||
|
@ -16,11 +16,11 @@ limitations under the License.
|
|||||||
#include "tensorflow/core/kernels/cwise_ops_common.h"
|
#include "tensorflow/core/kernels/cwise_ops_common.h"
|
||||||
|
|
||||||
namespace tensorflow {
|
namespace tensorflow {
|
||||||
REGISTER7(BinaryOp, CPU, "Minimum", functor::minimum, float, Eigen::half,
|
REGISTER6(BinaryOp, CPU, "Minimum", functor::minimum, float, Eigen::half,
|
||||||
bfloat16, double, int16, int32, int64);
|
bfloat16, double, int32, int64);
|
||||||
#if GOOGLE_CUDA || TENSORFLOW_USE_ROCM
|
#if GOOGLE_CUDA || TENSORFLOW_USE_ROCM
|
||||||
REGISTER5(BinaryOp, GPU, "Minimum", functor::minimum, float, Eigen::half,
|
REGISTER4(BinaryOp, GPU, "Minimum", functor::minimum, float, Eigen::half,
|
||||||
double, int16, int64);
|
double, int64);
|
||||||
|
|
||||||
// A special GPU kernel for int32.
|
// A special GPU kernel for int32.
|
||||||
// TODO(b/25387198): Also enable int32 in device memory. This kernel
|
// TODO(b/25387198): Also enable int32 in device memory. This kernel
|
||||||
|
@ -549,7 +549,7 @@ REGISTER_OP("Maximum")
|
|||||||
.Input("x: T")
|
.Input("x: T")
|
||||||
.Input("y: T")
|
.Input("y: T")
|
||||||
.Output("z: T")
|
.Output("z: T")
|
||||||
.Attr("T: {bfloat16, half, float, double, int16, int32, int64}")
|
.Attr("T: {bfloat16, half, float, double, int32, int64}")
|
||||||
.SetShapeFn(shape_inference::BroadcastBinaryOpShapeFn);
|
.SetShapeFn(shape_inference::BroadcastBinaryOpShapeFn);
|
||||||
|
|
||||||
// Note: This op is not commutative w.r.t. to all its inputs.
|
// Note: This op is not commutative w.r.t. to all its inputs.
|
||||||
@ -573,7 +573,7 @@ REGISTER_OP("Minimum")
|
|||||||
.Input("x: T")
|
.Input("x: T")
|
||||||
.Input("y: T")
|
.Input("y: T")
|
||||||
.Output("z: T")
|
.Output("z: T")
|
||||||
.Attr("T: {bfloat16, half, float, double, int16, int32, int64}")
|
.Attr("T: {bfloat16, half, float, double, int32, int64}")
|
||||||
.SetShapeFn(shape_inference::BroadcastBinaryOpShapeFn);
|
.SetShapeFn(shape_inference::BroadcastBinaryOpShapeFn);
|
||||||
|
|
||||||
REGISTER_OP("Mod")
|
REGISTER_OP("Mod")
|
||||||
|
@ -23709,7 +23709,6 @@ op {
|
|||||||
type: DT_HALF
|
type: DT_HALF
|
||||||
type: DT_FLOAT
|
type: DT_FLOAT
|
||||||
type: DT_DOUBLE
|
type: DT_DOUBLE
|
||||||
type: DT_INT16
|
|
||||||
type: DT_INT32
|
type: DT_INT32
|
||||||
type: DT_INT64
|
type: DT_INT64
|
||||||
}
|
}
|
||||||
@ -23965,7 +23964,6 @@ op {
|
|||||||
type: DT_HALF
|
type: DT_HALF
|
||||||
type: DT_FLOAT
|
type: DT_FLOAT
|
||||||
type: DT_DOUBLE
|
type: DT_DOUBLE
|
||||||
type: DT_INT16
|
|
||||||
type: DT_INT32
|
type: DT_INT32
|
||||||
type: DT_INT64
|
type: DT_INT64
|
||||||
}
|
}
|
||||||
|
@ -733,7 +733,7 @@ class MinMaxOpTest(test.TestCase):
|
|||||||
def testBasic(self):
|
def testBasic(self):
|
||||||
x = np.random.rand(1, 3, 2) * 100.
|
x = np.random.rand(1, 3, 2) * 100.
|
||||||
y = np.random.rand(1, 3, 2) * 100.
|
y = np.random.rand(1, 3, 2) * 100.
|
||||||
for t in [np.float16, np.float32, np.float64, np.int16, np.int32, np.int64]:
|
for t in [np.float16, np.float32, np.float64, np.int32, np.int64]:
|
||||||
self._compare(x.astype(t), y.astype(t), use_gpu=False)
|
self._compare(x.astype(t), y.astype(t), use_gpu=False)
|
||||||
self._compare(x.astype(t), y.astype(t), use_gpu=True)
|
self._compare(x.astype(t), y.astype(t), use_gpu=True)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user