diff options
Diffstat (limited to 'tensorflow/core/kernels/cwise_ops_common.cc')
-rw-r--r-- | tensorflow/core/kernels/cwise_ops_common.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tensorflow/core/kernels/cwise_ops_common.cc b/tensorflow/core/kernels/cwise_ops_common.cc index 693c6467ac..e561e59cf5 100644 --- a/tensorflow/core/kernels/cwise_ops_common.cc +++ b/tensorflow/core/kernels/cwise_ops_common.cc @@ -40,6 +40,11 @@ void BinaryOpShared::SetComputeError(OpKernelContext* ctx) { if ((op == "Div" || op == "Mod" || op == "FloorMod" || op == "FloorDiv") && DataTypeIsInteger(ctx->op_kernel().input_type(0))) { ctx->CtxFailure(errors::InvalidArgument("Integer division by zero")); + } else if ((op == "Pow") && + DataTypeIsInteger(ctx->op_kernel().input_type(0)) && + DataTypeIsSigned(ctx->op_kernel().input_type(1))) { + ctx->CtxFailure(errors::InvalidArgument( + "Integers to negative integer powers are not allowed")); } else { ctx->CtxFailure( errors::Internal("Unexpected error in binary operator " |