From 67d114bfceef73c9e75badcbe34484a35513e492 Mon Sep 17 00:00:00 2001 From: Shashi Shekhar Date: Sat, 17 Nov 2018 11:29:27 -0800 Subject: [PATCH] Deprecate tf.debugging. APIs for TF 2.0 Deprecate tf.debugging.(is_finite|is_inf|is_nan|is_non_decreasing|is_strictly_increasing) and rename to tf.math. variants. PiperOrigin-RevId: 221931279 --- .../api_def/python_api/api_def_IsFinite.pbtxt | 4 ++++ .../api_def/python_api/api_def_IsInf.pbtxt | 4 ++++ .../api_def/python_api/api_def_IsNan.pbtxt | 4 ++++ tensorflow/python/ops/check_ops.py | 20 +++++++++++++------ .../tools/api/golden/v1/tensorflow.math.pbtxt | 20 +++++++++++++++++++ .../api/golden/v2/tensorflow.debugging.pbtxt | 20 ------------------- .../tools/api/golden/v2/tensorflow.math.pbtxt | 20 +++++++++++++++++++ tensorflow/tools/compatibility/renames_v2.py | 15 +++++++++----- 8 files changed, 76 insertions(+), 31 deletions(-) diff --git a/tensorflow/core/api_def/python_api/api_def_IsFinite.pbtxt b/tensorflow/core/api_def/python_api/api_def_IsFinite.pbtxt index 91160bd8bfa..ccd736a483e 100644 --- a/tensorflow/core/api_def/python_api/api_def_IsFinite.pbtxt +++ b/tensorflow/core/api_def/python_api/api_def_IsFinite.pbtxt @@ -1,7 +1,11 @@ op { graph_op_name: "IsFinite" + endpoint { + name: "math.is_finite" + } endpoint { name: "debugging.is_finite" + deprecation_version: 2 } endpoint { name: "is_finite" diff --git a/tensorflow/core/api_def/python_api/api_def_IsInf.pbtxt b/tensorflow/core/api_def/python_api/api_def_IsInf.pbtxt index 7f029ee8cf0..3cbfb7317c1 100644 --- a/tensorflow/core/api_def/python_api/api_def_IsInf.pbtxt +++ b/tensorflow/core/api_def/python_api/api_def_IsInf.pbtxt @@ -1,7 +1,11 @@ op { graph_op_name: "IsInf" + endpoint { + name: "math.is_inf" + } endpoint { name: "debugging.is_inf" + deprecation_version: 2 } endpoint { name: "is_inf" diff --git a/tensorflow/core/api_def/python_api/api_def_IsNan.pbtxt b/tensorflow/core/api_def/python_api/api_def_IsNan.pbtxt index f2b8862c28d..b01536664e5 100644 --- a/tensorflow/core/api_def/python_api/api_def_IsNan.pbtxt +++ b/tensorflow/core/api_def/python_api/api_def_IsNan.pbtxt @@ -1,7 +1,11 @@ op { graph_op_name: "IsNan" + endpoint { + name: "math.is_nan" + } endpoint { name: "debugging.is_nan" + deprecation_version: 2 } endpoint { name: "is_nan" diff --git a/tensorflow/python/ops/check_ops.py b/tensorflow/python/ops/check_ops.py index 75dad172fca..f1f36269cf2 100644 --- a/tensorflow/python/ops/check_ops.py +++ b/tensorflow/python/ops/check_ops.py @@ -1530,9 +1530,13 @@ def is_numeric_tensor(tensor): @tf_export( - 'debugging.is_non_decreasing', - v1=['debugging.is_non_decreasing', 'is_non_decreasing']) -@deprecation.deprecated_endpoints('is_non_decreasing') + 'math.is_non_decreasing', + v1=[ + 'math.is_non_decreasing', 'debugging.is_non_decreasing', + 'is_non_decreasing' + ]) +@deprecation.deprecated_endpoints('debugging.is_non_decreasing', + 'is_non_decreasing') def is_non_decreasing(x, name=None): """Returns `True` if `x` is non-decreasing. @@ -1560,9 +1564,13 @@ def is_non_decreasing(x, name=None): @tf_export( - 'debugging.is_strictly_increasing', - v1=['debugging.is_strictly_increasing', 'is_strictly_increasing']) -@deprecation.deprecated_endpoints('is_strictly_increasing') + 'math.is_strictly_increasing', + v1=[ + 'math.is_strictly_increasing', 'debugging.is_strictly_increasing', + 'is_strictly_increasing' + ]) +@deprecation.deprecated_endpoints('debugging.is_strictly_increasing', + 'is_strictly_increasing') def is_strictly_increasing(x, name=None): """Returns `True` if `x` is strictly increasing. diff --git a/tensorflow/tools/api/golden/v1/tensorflow.math.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.math.pbtxt index a8334fdd1d1..67f348be218 100644 --- a/tensorflow/tools/api/golden/v1/tensorflow.math.pbtxt +++ b/tensorflow/tools/api/golden/v1/tensorflow.math.pbtxt @@ -176,6 +176,26 @@ tf_module { name: "invert_permutation" argspec: "args=[\'x\', \'name\'], varargs=None, keywords=None, defaults=[\'None\'], " } + member_method { + name: "is_finite" + argspec: "args=[\'x\', \'name\'], varargs=None, keywords=None, defaults=[\'None\'], " + } + member_method { + name: "is_inf" + argspec: "args=[\'x\', \'name\'], varargs=None, keywords=None, defaults=[\'None\'], " + } + member_method { + name: "is_nan" + argspec: "args=[\'x\', \'name\'], varargs=None, keywords=None, defaults=[\'None\'], " + } + member_method { + name: "is_non_decreasing" + argspec: "args=[\'x\', \'name\'], varargs=None, keywords=None, defaults=[\'None\'], " + } + member_method { + name: "is_strictly_increasing" + argspec: "args=[\'x\', \'name\'], varargs=None, keywords=None, defaults=[\'None\'], " + } member_method { name: "l2_normalize" argspec: "args=[\'x\', \'axis\', \'epsilon\', \'name\', \'dim\'], varargs=None, keywords=None, defaults=[\'None\', \'1e-12\', \'None\', \'None\'], " diff --git a/tensorflow/tools/api/golden/v2/tensorflow.debugging.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.debugging.pbtxt index 5d8afcd8b25..fbc5cd2df05 100644 --- a/tensorflow/tools/api/golden/v2/tensorflow.debugging.pbtxt +++ b/tensorflow/tools/api/golden/v2/tensorflow.debugging.pbtxt @@ -88,28 +88,8 @@ tf_module { name: "check_numerics" argspec: "args=[\'tensor\', \'message\', \'name\'], varargs=None, keywords=None, defaults=[\'None\'], " } - member_method { - name: "is_finite" - argspec: "args=[\'x\', \'name\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "is_inf" - argspec: "args=[\'x\', \'name\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "is_nan" - argspec: "args=[\'x\', \'name\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "is_non_decreasing" - argspec: "args=[\'x\', \'name\'], varargs=None, keywords=None, defaults=[\'None\'], " - } member_method { name: "is_numeric_tensor" argspec: "args=[\'tensor\'], varargs=None, keywords=None, defaults=None" } - member_method { - name: "is_strictly_increasing" - argspec: "args=[\'x\', \'name\'], varargs=None, keywords=None, defaults=[\'None\'], " - } } diff --git a/tensorflow/tools/api/golden/v2/tensorflow.math.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.math.pbtxt index a7638ffde64..e6b8fd225db 100644 --- a/tensorflow/tools/api/golden/v2/tensorflow.math.pbtxt +++ b/tensorflow/tools/api/golden/v2/tensorflow.math.pbtxt @@ -176,6 +176,26 @@ tf_module { name: "invert_permutation" argspec: "args=[\'x\', \'name\'], varargs=None, keywords=None, defaults=[\'None\'], " } + member_method { + name: "is_finite" + argspec: "args=[\'x\', \'name\'], varargs=None, keywords=None, defaults=[\'None\'], " + } + member_method { + name: "is_inf" + argspec: "args=[\'x\', \'name\'], varargs=None, keywords=None, defaults=[\'None\'], " + } + member_method { + name: "is_nan" + argspec: "args=[\'x\', \'name\'], varargs=None, keywords=None, defaults=[\'None\'], " + } + member_method { + name: "is_non_decreasing" + argspec: "args=[\'x\', \'name\'], varargs=None, keywords=None, defaults=[\'None\'], " + } + member_method { + name: "is_strictly_increasing" + argspec: "args=[\'x\', \'name\'], varargs=None, keywords=None, defaults=[\'None\'], " + } member_method { name: "l2_normalize" argspec: "args=[\'x\', \'axis\', \'epsilon\', \'name\', \'dim\'], varargs=None, keywords=None, defaults=[\'None\', \'1e-12\', \'None\', \'None\'], " diff --git a/tensorflow/tools/compatibility/renames_v2.py b/tensorflow/tools/compatibility/renames_v2.py index 423ff9cdc3c..e2bf6bf3a78 100644 --- a/tensorflow/tools/compatibility/renames_v2.py +++ b/tensorflow/tools/compatibility/renames_v2.py @@ -104,6 +104,11 @@ renames = { 'tf.count_up_to': 'tf.compat.v1.count_up_to', 'tf.cross': 'tf.linalg.cross', 'tf.cumprod': 'tf.math.cumprod', + 'tf.debugging.is_finite': 'tf.math.is_finite', + 'tf.debugging.is_inf': 'tf.math.is_inf', + 'tf.debugging.is_nan': 'tf.math.is_nan', + 'tf.debugging.is_non_decreasing': 'tf.math.is_non_decreasing', + 'tf.debugging.is_strictly_increasing': 'tf.math.is_strictly_increasing', 'tf.decode_base64': 'tf.io.decode_base64', 'tf.decode_compressed': 'tf.io.decode_compressed', 'tf.decode_csv': 'tf.io.decode_csv', @@ -196,12 +201,12 @@ renames = { 'tf.initializers.tables_initializer': 'tf.compat.v1.initializers.tables_initializer', 'tf.initializers.variables': 'tf.compat.v1.initializers.variables', 'tf.invert_permutation': 'tf.math.invert_permutation', - 'tf.is_finite': 'tf.debugging.is_finite', - 'tf.is_inf': 'tf.debugging.is_inf', - 'tf.is_nan': 'tf.debugging.is_nan', - 'tf.is_non_decreasing': 'tf.debugging.is_non_decreasing', + 'tf.is_finite': 'tf.math.is_finite', + 'tf.is_inf': 'tf.math.is_inf', + 'tf.is_nan': 'tf.math.is_nan', + 'tf.is_non_decreasing': 'tf.math.is_non_decreasing', 'tf.is_numeric_tensor': 'tf.debugging.is_numeric_tensor', - 'tf.is_strictly_increasing': 'tf.debugging.is_strictly_increasing', + 'tf.is_strictly_increasing': 'tf.math.is_strictly_increasing', 'tf.is_variable_initialized': 'tf.compat.v1.is_variable_initialized', 'tf.keras.backend.get_session': 'tf.compat.v1.keras.backend.get_session', 'tf.layers.AveragePooling1D': 'tf.compat.v1.layers.AveragePooling1D',