From fea13a48df3ac1be2f9aab25eb0035b98f494dea Mon Sep 17 00:00:00 2001 From: Dan Moldovan Date: Thu, 14 Mar 2019 18:25:38 -0700 Subject: [PATCH] Remove deprecated arguments from the exported API declarations. PiperOrigin-RevId: 238561912 --- tensorflow/python/autograph/core/converter.py | 14 -------------- tensorflow/python/autograph/impl/api.py | 19 ++----------------- ...ow.autograph.experimental.-verbosity.pbtxt | 12 ------------ .../tensorflow.autograph.experimental.pbtxt | 4 ---- .../api/golden/v1/tensorflow.autograph.pbtxt | 4 ++-- ...ow.autograph.experimental.-verbosity.pbtxt | 12 ------------ .../tensorflow.autograph.experimental.pbtxt | 4 ---- .../api/golden/v2/tensorflow.autograph.pbtxt | 4 ++-- 8 files changed, 6 insertions(+), 67 deletions(-) delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.autograph.experimental.-verbosity.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.autograph.experimental.-verbosity.pbtxt diff --git a/tensorflow/python/autograph/core/converter.py b/tensorflow/python/autograph/core/converter.py index 2e106ed1795..5b7880a2999 100644 --- a/tensorflow/python/autograph/core/converter.py +++ b/tensorflow/python/autograph/core/converter.py @@ -88,20 +88,6 @@ from tensorflow.python.util.tf_export import tf_export # TODO(mdan): Add a test specific to this converter. -# TODO(mdan): Remove when updating the API. -@tf_export('autograph.experimental.Verbosity') -class Verbosity(enum.IntEnum): - """Represents conversion verbosity levels. - - Attributes: - BRIEF: No logging, minimal error messages. - VERBOSE: Detailed logging of generated code, detailed error messages. - """ - - BRIEF = 0 - VERBOSE = 1 - - @tf_export('autograph.experimental.Feature') class Feature(enum.Enum): """Represents conversion options that can be toggled on or off. diff --git a/tensorflow/python/autograph/impl/api.py b/tensorflow/python/autograph/impl/api.py index 9e223d1992b..67fcfb96c9a 100644 --- a/tensorflow/python/autograph/impl/api.py +++ b/tensorflow/python/autograph/impl/api.py @@ -377,16 +377,12 @@ def _is_not_callable(obj): return False -# TODO(mdan): Remove obsolete args. @tf_export('autograph.to_graph') def to_graph(entity, recursive=True, arg_values=None, arg_types=None, - experimental_optional_features=converter.Feature.ALL, - experimental_strip_decorators=None, - experimental_verbose=converter.Verbosity.BRIEF, - experimental_partial_types=None): + experimental_optional_features=converter.Feature.ALL): """Converts a Python entity into a TensorFlow graph. Also see: `tf.autograph.to_code`, `tf.function`. @@ -442,9 +438,6 @@ def to_graph(entity, experimental_optional_features: `None`, a tuple of, or a single `tf.autograph.experimental.Feature` value. Controls the use of optional features in the conversion process. - experimental_strip_decorators: Deprecated, unused. - experimental_verbose: Deprecated, unused. - experimental_partial_types: Deprecated, unused. Returns: Same as `entity`, the converted Python function or class. @@ -452,10 +445,6 @@ def to_graph(entity, Raises: ValueError: If the entity could not be converted. """ - del experimental_strip_decorators - del experimental_verbose - del experimental_partial_types - try: program_ctx = converter.ProgramContext( options=converter.ConversionOptions( @@ -520,8 +509,7 @@ def to_code(entity, arg_values=None, arg_types=None, indentation=' ', - experimental_optional_features=converter.Feature.ALL, - experimental_partial_types=None): + experimental_optional_features=converter.Feature.ALL): """Similar to `to_graph`, but returns Python source code as a string. Also see: `tf.autograph.to_graph`. @@ -544,13 +532,10 @@ def to_code(entity, experimental_optional_features: `None`, a tuple of, or a single `tf.autograph.experimental.Feature` value. Controls the use of optional features in the conversion process. - experimental_partial_types: Deprecated, unused. Returns: The converted code as string. """ - del experimental_partial_types - program_ctx = converter.ProgramContext( options=converter.ConversionOptions( recursive=recursive, diff --git a/tensorflow/tools/api/golden/v1/tensorflow.autograph.experimental.-verbosity.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.autograph.experimental.-verbosity.pbtxt deleted file mode 100644 index c4d5b77c073..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.autograph.experimental.-verbosity.pbtxt +++ /dev/null @@ -1,12 +0,0 @@ -path: "tensorflow.autograph.experimental.Verbosity" -tf_class { - is_instance: "" - member { - name: "BRIEF" - mtype: "" - } - member { - name: "VERBOSE" - mtype: "" - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.autograph.experimental.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.autograph.experimental.pbtxt index 5747dac7ab2..cd8f0716d48 100644 --- a/tensorflow/tools/api/golden/v1/tensorflow.autograph.experimental.pbtxt +++ b/tensorflow/tools/api/golden/v1/tensorflow.autograph.experimental.pbtxt @@ -4,8 +4,4 @@ tf_module { name: "Feature" mtype: "" } - member { - name: "Verbosity" - mtype: "" - } } diff --git a/tensorflow/tools/api/golden/v1/tensorflow.autograph.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.autograph.pbtxt index 0baf6e03552..8880ed4f0cb 100644 --- a/tensorflow/tools/api/golden/v1/tensorflow.autograph.pbtxt +++ b/tensorflow/tools/api/golden/v1/tensorflow.autograph.pbtxt @@ -10,11 +10,11 @@ tf_module { } member_method { name: "to_code" - argspec: "args=[\'entity\', \'recursive\', \'arg_values\', \'arg_types\', \'indentation\', \'experimental_optional_features\', \'experimental_partial_types\'], varargs=None, keywords=None, defaults=[\'True\', \'None\', \'None\', \' \', \'Feature.ALL\', \'None\'], " + argspec: "args=[\'entity\', \'recursive\', \'arg_values\', \'arg_types\', \'indentation\', \'experimental_optional_features\'], varargs=None, keywords=None, defaults=[\'True\', \'None\', \'None\', \' \', \'Feature.ALL\'], " } member_method { name: "to_graph" - argspec: "args=[\'entity\', \'recursive\', \'arg_values\', \'arg_types\', \'experimental_optional_features\', \'experimental_strip_decorators\', \'experimental_verbose\', \'experimental_partial_types\'], varargs=None, keywords=None, defaults=[\'True\', \'None\', \'None\', \'Feature.ALL\', \'None\', \'Verbosity.BRIEF\', \'None\'], " + argspec: "args=[\'entity\', \'recursive\', \'arg_values\', \'arg_types\', \'experimental_optional_features\'], varargs=None, keywords=None, defaults=[\'True\', \'None\', \'None\', \'Feature.ALL\'], " } member_method { name: "trace" diff --git a/tensorflow/tools/api/golden/v2/tensorflow.autograph.experimental.-verbosity.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.autograph.experimental.-verbosity.pbtxt deleted file mode 100644 index c4d5b77c073..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.autograph.experimental.-verbosity.pbtxt +++ /dev/null @@ -1,12 +0,0 @@ -path: "tensorflow.autograph.experimental.Verbosity" -tf_class { - is_instance: "" - member { - name: "BRIEF" - mtype: "" - } - member { - name: "VERBOSE" - mtype: "" - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.autograph.experimental.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.autograph.experimental.pbtxt index 5747dac7ab2..cd8f0716d48 100644 --- a/tensorflow/tools/api/golden/v2/tensorflow.autograph.experimental.pbtxt +++ b/tensorflow/tools/api/golden/v2/tensorflow.autograph.experimental.pbtxt @@ -4,8 +4,4 @@ tf_module { name: "Feature" mtype: "" } - member { - name: "Verbosity" - mtype: "" - } } diff --git a/tensorflow/tools/api/golden/v2/tensorflow.autograph.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.autograph.pbtxt index 0baf6e03552..8880ed4f0cb 100644 --- a/tensorflow/tools/api/golden/v2/tensorflow.autograph.pbtxt +++ b/tensorflow/tools/api/golden/v2/tensorflow.autograph.pbtxt @@ -10,11 +10,11 @@ tf_module { } member_method { name: "to_code" - argspec: "args=[\'entity\', \'recursive\', \'arg_values\', \'arg_types\', \'indentation\', \'experimental_optional_features\', \'experimental_partial_types\'], varargs=None, keywords=None, defaults=[\'True\', \'None\', \'None\', \' \', \'Feature.ALL\', \'None\'], " + argspec: "args=[\'entity\', \'recursive\', \'arg_values\', \'arg_types\', \'indentation\', \'experimental_optional_features\'], varargs=None, keywords=None, defaults=[\'True\', \'None\', \'None\', \' \', \'Feature.ALL\'], " } member_method { name: "to_graph" - argspec: "args=[\'entity\', \'recursive\', \'arg_values\', \'arg_types\', \'experimental_optional_features\', \'experimental_strip_decorators\', \'experimental_verbose\', \'experimental_partial_types\'], varargs=None, keywords=None, defaults=[\'True\', \'None\', \'None\', \'Feature.ALL\', \'None\', \'Verbosity.BRIEF\', \'None\'], " + argspec: "args=[\'entity\', \'recursive\', \'arg_values\', \'arg_types\', \'experimental_optional_features\'], varargs=None, keywords=None, defaults=[\'True\', \'None\', \'None\', \'Feature.ALL\'], " } member_method { name: "trace"