Add support of int8/uint8/int16/uint16 for tf.subtract

This fix adds support of int8/uint8/int16/uint16 for tf.subtract
(on CPU only)

This fix fixes 12571.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
This commit is contained in:
Yong Tang 2017-08-24 23:54:51 +00:00 committed by Martin Wicke
parent 0f726c6b71
commit 519e91ddb0
2 changed files with 5 additions and 2 deletions

View File

@ -18,7 +18,10 @@ limitations under the License.
namespace tensorflow {
REGISTER7(BinaryOp, CPU, "Sub", functor::sub, float, Eigen::half, double, int32,
int64, complex64, complex128);
#if defined(__ANDROID_TYPES_SLIM__)
#if !defined(__ANDROID_TYPES_SLIM__)
// Sub op for int8, uint8, int16, uint16
REGISTER4(BinaryOp, CPU, "Sub", functor::sub, int8, uint8, int16, uint16);
#else
// We only register the first type when we have multi-argument calls in the
// case where we're trying to reduce executable size, but it turns out that the
// int32 version of this op is needed, so explicitly include it.

View File

@ -499,7 +499,7 @@ Returns x + y element-wise.
)doc");
REGISTER_OP("Sub")
.BINARY_FEWER()
.BINARY_MORE()
.SetShapeFn(shape_inference::BroadcastBinaryOpShapeFn)
.Doc(R"doc(
Returns x - y element-wise.