From 78b11cef0ce2092c52f834648427e2a5773424a1 Mon Sep 17 00:00:00 2001 From: Andrew Selle Date: Thu, 12 Jan 2017 16:13:55 -0800 Subject: [PATCH] Remove tf.mul, tf.neg and tf.sub from the public API Change: 144384783 --- .../contrib/layers/python/layers/regularizers.py | 2 +- .../kernel_tests/control_flow_ops_py_test.py | 2 +- tensorflow/python/ops/math_ops.py | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tensorflow/contrib/layers/python/layers/regularizers.py b/tensorflow/contrib/layers/python/layers/regularizers.py index a6c476b54fc..02eb2b390c6 100644 --- a/tensorflow/contrib/layers/python/layers/regularizers.py +++ b/tensorflow/contrib/layers/python/layers/regularizers.py @@ -65,7 +65,7 @@ def l1_regularizer(scale, scope=None): my_scale = ops.convert_to_tensor(scale, dtype=weights.dtype.base_dtype, name='scale') - return standard_ops.mul( + return standard_ops.multiply( my_scale, standard_ops.reduce_sum(standard_ops.abs(weights)), name=name) diff --git a/tensorflow/python/kernel_tests/control_flow_ops_py_test.py b/tensorflow/python/kernel_tests/control_flow_ops_py_test.py index bd35c2edaa1..1e510b28689 100644 --- a/tensorflow/python/kernel_tests/control_flow_ops_py_test.py +++ b/tensorflow/python/kernel_tests/control_flow_ops_py_test.py @@ -2075,7 +2075,7 @@ class ControlFlowTest(test.TestCase): y = constant_op.constant(2.0, name="y") c = lambda x: math_ops.less(x, 100.0) - b = lambda x: math_ops.mul(x, y) + b = lambda x: math_ops.multiply(x, y) rx = control_flow_ops.while_loop(c, b, [x]) rg = gradients_impl.gradients(rx, y)[0] diff --git a/tensorflow/python/ops/math_ops.py b/tensorflow/python/ops/math_ops.py index 071f970c580..c9ad0936a5b 100644 --- a/tensorflow/python/ops/math_ops.py +++ b/tensorflow/python/ops/math_ops.py @@ -362,10 +362,10 @@ multiply.__doc__ = gen_math_ops._mul.__doc__.replace("Mul", "`tf.multiply`") @deprecated( "2016-12-30", "`tf.mul(x, y)` is deprecated, please use `tf.multiply(x, y)` or `x * y`") -def mul(x, y, name=None): +def _mul(x, y, name=None): return gen_math_ops._mul(x, y, name) -mul.__doc__ = (gen_math_ops._mul.__doc__ - + ("" if mul.__doc__ is None else mul.__doc__)) +_mul.__doc__ = (gen_math_ops._mul.__doc__ + + ("" if _mul.__doc__ is None else _mul.__doc__)) def subtract(x, y, name=None): @@ -377,10 +377,10 @@ subtract.__doc__ = gen_math_ops._sub.__doc__.replace("`Sub`", "`tf.subtract`") @deprecated( "2016-12-30", "`tf.sub(x, y)` is deprecated, please use `tf.subtract(x, y)` or `x - y`") -def sub(x, y, name=None): +def _sub(x, y, name=None): return gen_math_ops._sub(x, y, name) -sub.__doc__ = (gen_math_ops._sub.__doc__ - + ("" if sub.__doc__ is None else sub.__doc__)) +_sub.__doc__ = (gen_math_ops._sub.__doc__ + + ("" if _sub.__doc__ is None else _sub.__doc__)) # pylint: disable=g-docstring-has-escape @@ -411,7 +411,7 @@ def negative(x, name=None): @deprecated( "2016-12-30", "`tf.neg(x)` is deprecated, please use `tf.negative(x)` or `-x`") -def neg(x, name=None): +def _neg(x, name=None): """Computes numerical negative value element-wise. I.e., \\(y = -x\\).