Skip to content

Commit fe965a8

Browse files
annarevtensorflower-gardener
authored andcommitted
Removing remove_undocumented calls from tensorflow/python.
PiperOrigin-RevId: 194274698
1 parent 3563165 commit fe965a8

48 files changed

Lines changed: 21 additions & 923 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎tensorflow/contrib/framework/__init__.py‎

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@
108108

109109
# pylint: disable=unused-import,wildcard-import
110110
from tensorflow.contrib.framework.python.framework import *
111+
from tensorflow.contrib.framework.python.framework import nest
111112
from tensorflow.contrib.framework.python.ops import *
112113
# pylint: enable=unused-import,wildcard-import
113114

@@ -126,5 +127,20 @@
126127
from tensorflow.python.util.all_util import remove_undocumented
127128

128129
_allowed_symbols = ['nest', 'broadcast_to']
129-
130+
_nest_allowed_symbols = [
131+
'assert_same_structure',
132+
'is_sequence',
133+
'flatten',
134+
'flatten_dict_items',
135+
'pack_sequence_as',
136+
'map_structure',
137+
'assert_shallow_structure',
138+
'flatten_up_to',
139+
'map_structure_up_to',
140+
'get_traverse_shallow_structure',
141+
'yield_flat_paths',
142+
'flatten_with_joined_string_paths',
143+
]
144+
145+
remove_undocumented(nest.__name__, allowed_exception_list=_nest_allowed_symbols)
130146
remove_undocumented(__name__, allowed_exception_list=_allowed_symbols)

‎tensorflow/contrib/meta_graph_transform/meta_graph_transform.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@
1313
# limitations under the License.
1414
# ==============================================================================
1515

16-
"""Apply graph_transforms tool to MetaGraphDefs."""
16+
"""Apply graph_transforms tool to MetaGraphDefs.
17+
18+
@@meta_graph_transform
19+
"""
1720

1821
from __future__ import absolute_import
1922
from __future__ import division

‎tensorflow/python/__init__.py‎

Lines changed: 0 additions & 166 deletions
Original file line numberDiff line numberDiff line change
@@ -120,31 +120,9 @@
120120
from tensorflow.python.platform import sysconfig
121121
from tensorflow.python.platform import test
122122

123-
from tensorflow.python.util.all_util import remove_undocumented
124123
from tensorflow.python.util.all_util import make_all
125124
from tensorflow.python.util.tf_export import tf_export
126125

127-
# Import modules whose docstrings contribute, for use by remove_undocumented
128-
# below.
129-
from tensorflow.python.client import client_lib
130-
from tensorflow.python.framework import constant_op
131-
from tensorflow.python.framework import framework_lib
132-
from tensorflow.python.framework import subscribe
133-
from tensorflow.python.ops import array_ops
134-
from tensorflow.python.ops import check_ops
135-
from tensorflow.python.ops import confusion_matrix as confusion_matrix_m
136-
from tensorflow.python.ops import control_flow_ops
137-
from tensorflow.python.ops import functional_ops
138-
from tensorflow.python.ops import histogram_ops
139-
from tensorflow.python.ops import io_ops
140-
from tensorflow.python.ops import math_ops
141-
from tensorflow.python.ops import script_ops
142-
from tensorflow.python.ops import session_ops
143-
from tensorflow.python.ops import sparse_ops
144-
from tensorflow.python.ops import state_ops
145-
from tensorflow.python.ops import string_ops
146-
from tensorflow.python.ops import tensor_array_ops
147-
148126
# Eager execution
149127
from tensorflow.python.eager.context import executing_eagerly
150128
from tensorflow.python.framework.ops import enable_eager_execution
@@ -163,35 +141,6 @@
163141
nn.static_state_saving_rnn = rnn.static_state_saving_rnn
164142
nn.rnn_cell = rnn_cell
165143

166-
# Symbols whitelisted for export without documentation.
167-
# TODO(cwhipkey): review these and move to contrib, expose through
168-
# documentation, or remove.
169-
_allowed_symbols = [
170-
'AttrValue',
171-
'ConfigProto',
172-
'ClusterDef',
173-
'DeviceSpec',
174-
'Event',
175-
'GPUOptions',
176-
'GRAPH_DEF_VERSION',
177-
'GRAPH_DEF_VERSION_MIN_CONSUMER',
178-
'GRAPH_DEF_VERSION_MIN_PRODUCER',
179-
'GraphDef',
180-
'GraphOptions',
181-
'HistogramProto',
182-
'LogMessage',
183-
'MetaGraphDef',
184-
'NameAttrList',
185-
'NodeDef',
186-
'OptimizerOptions',
187-
'RunOptions',
188-
'RunMetadata',
189-
'SessionLog',
190-
'Summary',
191-
'SummaryMetadata',
192-
'TensorInfo', # Used for tf.saved_model functionality.
193-
]
194-
195144
# Export protos
196145
# pylint: disable=undefined-variable
197146
tf_export('AttrValue')(AttrValue)
@@ -216,121 +165,6 @@
216165
tf_export('TensorInfo')(TensorInfo)
217166
# pylint: enable=undefined-variable
218167

219-
220-
# The following symbols are kept for compatibility. It is our plan
221-
# to remove them in the future.
222-
_allowed_symbols.extend([
223-
'arg_max',
224-
'arg_min',
225-
'create_partitioned_variables',
226-
'deserialize_many_sparse',
227-
'lin_space',
228-
'listdiff', # Use tf.listdiff instead.
229-
'parse_single_sequence_example',
230-
'serialize_many_sparse',
231-
'serialize_sparse',
232-
'sparse_matmul', ## use tf.matmul instead.
233-
])
234-
235-
# This is needed temporarily because we import it explicitly.
236-
_allowed_symbols.extend([
237-
'pywrap_tensorflow',
238-
])
239-
240-
# Dtypes exported by framework/dtypes.py.
241-
# TODO(cwhipkey): expose these through documentation.
242-
_allowed_symbols.extend([
243-
'QUANTIZED_DTYPES',
244-
'bfloat16',
245-
'bool',
246-
'complex64',
247-
'complex128',
248-
'double',
249-
'half',
250-
'float16',
251-
'float32',
252-
'float64',
253-
'int16',
254-
'int32',
255-
'int64',
256-
'int8',
257-
'qint16',
258-
'qint32',
259-
'qint8',
260-
'quint16',
261-
'quint8',
262-
'string',
263-
'uint64',
264-
'uint32',
265-
'uint16',
266-
'uint8',
267-
'resource',
268-
'variant',
269-
])
270-
271-
# Export modules and constants.
272-
_allowed_symbols.extend([
273-
'app',
274-
'bitwise',
275-
'compat',
276-
'data',
277-
'distributions',
278-
'errors',
279-
'estimator',
280-
'feature_column',
281-
'flags',
282-
'gfile',
283-
'graph_util',
284-
'image',
285-
'initializers',
286-
'keras',
287-
'layers',
288-
'linalg',
289-
'logging',
290-
'losses',
291-
'manip',
292-
'metrics',
293-
'newaxis',
294-
'nn',
295-
'profiler',
296-
'python_io',
297-
'resource_loader',
298-
'saved_model',
299-
'sets',
300-
'spectral',
301-
'summary',
302-
'sysconfig',
303-
'test',
304-
'train',
305-
'user_ops',
306-
])
307-
308-
# Variables framework.versions:
309-
_allowed_symbols.extend([
310-
'VERSION',
311-
'GIT_VERSION',
312-
'COMPILER_VERSION',
313-
'CXX11_ABI_FLAG',
314-
'MONOLITHIC_BUILD',
315-
])
316-
317-
# Eager execution
318-
_allowed_symbols.extend([
319-
'enable_eager_execution',
320-
'executing_eagerly',
321-
])
322-
323-
# Remove all extra symbols that don't have a docstring or are not explicitly
324-
# referenced in the whitelist.
325-
remove_undocumented(__name__, _allowed_symbols, [
326-
framework_lib, array_ops, check_ops, client_lib, compat, constant_op,
327-
control_flow_ops, confusion_matrix_m, data, distributions,
328-
functional_ops, histogram_ops, io_ops, keras, layers,
329-
losses, math_ops, metrics, nn, profiler, resource_loader, sets, script_ops,
330-
session_ops, sparse_ops, state_ops, string_ops, summary, tensor_array_ops,
331-
train
332-
])
333-
334168
# Special dunders that we choose to export:
335169
_exported_dunders = set([
336170
'__version__',

‎tensorflow/python/data/__init__.py‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,3 @@
3434
from tensorflow.python.data.ops.readers import TextLineDataset
3535
from tensorflow.python.data.ops.readers import TFRecordDataset
3636
# pylint: enable=unused-import
37-
38-
from tensorflow.python.util.all_util import remove_undocumented
39-
remove_undocumented(__name__)

‎tensorflow/python/data/util/nest.py‎

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
import six as _six
4545

4646
from tensorflow.python.framework import sparse_tensor as _sparse_tensor
47-
from tensorflow.python.util.all_util import remove_undocumented
4847

4948

5049
def _sorted(dict_):
@@ -538,16 +537,3 @@ def map_structure_up_to(shallow_tree, func, *inputs):
538537
results = [func(*tensors) for tensors in zip(*all_flattened_up_to)]
539538
return pack_sequence_as(structure=shallow_tree, flat_sequence=results)
540539

541-
542-
_allowed_symbols = [
543-
"assert_same_structure",
544-
"is_sequence",
545-
"flatten",
546-
"pack_sequence_as",
547-
"map_structure",
548-
"assert_shallow_structure",
549-
"flatten_up_to",
550-
"map_structure_up_to",
551-
]
552-
553-
remove_undocumented(__name__, _allowed_symbols)

‎tensorflow/python/estimator/estimator_lib.py‎

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -47,45 +47,4 @@
4747
from tensorflow.python.estimator.training import TrainSpec
4848

4949

50-
from tensorflow.python.util.all_util import remove_undocumented
5150
# pylint: enable=unused-import,line-too-long,wildcard-import
52-
53-
_allowed_symbols = [
54-
# Canned Estimators
55-
'BaselineClassifier',
56-
'BaselineRegressor',
57-
'BoostedTreesClassifier',
58-
'BoostedTreesRegressor',
59-
'DNNClassifier',
60-
'DNNRegressor',
61-
'DNNLinearCombinedClassifier',
62-
'DNNLinearCombinedRegressor',
63-
'LinearClassifier',
64-
'LinearRegressor',
65-
66-
# I/O
67-
'classifier_parse_example_spec',
68-
'regressor_parse_example_spec',
69-
'inputs',
70-
'export',
71-
72-
# Estimator
73-
'Estimator',
74-
'EstimatorSpec',
75-
'ModeKeys',
76-
'RunConfig',
77-
78-
# Training utilities
79-
'train_and_evaluate',
80-
'EvalSpec',
81-
'TrainSpec',
82-
'Exporter',
83-
'LatestExporter',
84-
'FinalExporter',
85-
86-
# Warm-starting
87-
'WarmStartSettings',
88-
'VocabInfo',
89-
]
90-
91-
remove_undocumented(__name__, allowed_exception_list=_allowed_symbols)

‎tensorflow/python/estimator/export/export_lib.py‎

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,5 @@
2828
from tensorflow.python.estimator.export.export_output import PredictOutput
2929
from tensorflow.python.estimator.export.export_output import RegressionOutput
3030

31-
from tensorflow.python.util.all_util import remove_undocumented
3231
# pylint: enable=unused-import,line-too-long
3332

34-
_allowed_symbols = [
35-
'build_parsing_serving_input_receiver_fn',
36-
'build_raw_serving_input_receiver_fn',
37-
'ServingInputReceiver',
38-
'TensorServingInputReceiver',
39-
'ClassificationOutput',
40-
'ExportOutput',
41-
'PredictOutput',
42-
'RegressionOutput',
43-
]
44-
45-
remove_undocumented(__name__, allowed_exception_list=_allowed_symbols)

‎tensorflow/python/estimator/inputs/inputs.py‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,4 @@
2222
from tensorflow.python.estimator.inputs.numpy_io import numpy_input_fn
2323
from tensorflow.python.estimator.inputs.pandas_io import pandas_input_fn
2424

25-
from tensorflow.python.util.all_util import remove_undocumented
2625
# pylint: enable=unused-import,line-too-long
27-
28-
_allowed_symbols = [
29-
'numpy_input_fn',
30-
'pandas_input_fn'
31-
]
32-
33-
remove_undocumented(__name__, allowed_exception_list=_allowed_symbols)

‎tensorflow/python/feature_column/feature_column_lib.py‎

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,4 @@
2020

2121
# pylint: disable=unused-import,line-too-long,wildcard-import
2222
from tensorflow.python.feature_column.feature_column import *
23-
24-
from tensorflow.python.util.all_util import remove_undocumented
2523
# pylint: enable=unused-import,line-too-long
26-
27-
_allowed_symbols = [
28-
'input_layer',
29-
'linear_model',
30-
'make_parse_example_spec',
31-
'embedding_column',
32-
'shared_embedding_columns',
33-
'crossed_column',
34-
'numeric_column',
35-
'bucketized_column',
36-
'categorical_column_with_hash_bucket',
37-
'categorical_column_with_vocabulary_file',
38-
'categorical_column_with_vocabulary_list',
39-
'categorical_column_with_identity',
40-
'weighted_categorical_column',
41-
'indicator_column',
42-
]
43-
44-
remove_undocumented(__name__, allowed_exception_list=_allowed_symbols)

0 commit comments

Comments
 (0)