diff --git a/tensorflow/core/kernels/softplus_op.h b/tensorflow/core/kernels/softplus_op.h index 3b35af07039..0e4de9cdeb1 100644 --- a/tensorflow/core/kernels/softplus_op.h +++ b/tensorflow/core/kernels/softplus_op.h @@ -53,7 +53,7 @@ struct Softplus { activations.device(d) = too_large.select( features, // softplus(x) ~= x for x large too_small.select(features_exp, // softplus(x) ~= exp(x) for x small - (features_exp + features.constant(T(1))).log())); + features_exp.log1p())); } };