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:
parent
0f726c6b71
commit
519e91ddb0
@ -18,7 +18,10 @@ limitations under the License.
|
|||||||
namespace tensorflow {
|
namespace tensorflow {
|
||||||
REGISTER7(BinaryOp, CPU, "Sub", functor::sub, float, Eigen::half, double, int32,
|
REGISTER7(BinaryOp, CPU, "Sub", functor::sub, float, Eigen::half, double, int32,
|
||||||
int64, complex64, complex128);
|
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
|
// 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
|
// 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.
|
// int32 version of this op is needed, so explicitly include it.
|
||||||
|
@ -499,7 +499,7 @@ Returns x + y element-wise.
|
|||||||
)doc");
|
)doc");
|
||||||
|
|
||||||
REGISTER_OP("Sub")
|
REGISTER_OP("Sub")
|
||||||
.BINARY_FEWER()
|
.BINARY_MORE()
|
||||||
.SetShapeFn(shape_inference::BroadcastBinaryOpShapeFn)
|
.SetShapeFn(shape_inference::BroadcastBinaryOpShapeFn)
|
||||||
.Doc(R"doc(
|
.Doc(R"doc(
|
||||||
Returns x - y element-wise.
|
Returns x - y element-wise.
|
||||||
|
Loading…
Reference in New Issue
Block a user