Removing remove_undocumented calls from tensorflow/python.

PiperOrigin-RevId: 194274698
This commit is contained in:
Anna R 2018-04-25 11:52:08 -07:00 committed by TensorFlower Gardener
parent 3563165fb8
commit fe965a8502
48 changed files with 20 additions and 922 deletions

View File

@ -108,6 +108,7 @@ from __future__ import print_function
# pylint: disable=unused-import,wildcard-import
from tensorflow.contrib.framework.python.framework import *
from tensorflow.contrib.framework.python.framework import nest
from tensorflow.contrib.framework.python.ops import *
# pylint: enable=unused-import,wildcard-import
@ -126,5 +127,20 @@ from tensorflow.python.ops.init_ops import convolutional_orthogonal_3d
from tensorflow.python.util.all_util import remove_undocumented
_allowed_symbols = ['nest', 'broadcast_to']
_nest_allowed_symbols = [
'assert_same_structure',
'is_sequence',
'flatten',
'flatten_dict_items',
'pack_sequence_as',
'map_structure',
'assert_shallow_structure',
'flatten_up_to',
'map_structure_up_to',
'get_traverse_shallow_structure',
'yield_flat_paths',
'flatten_with_joined_string_paths',
]
remove_undocumented(nest.__name__, allowed_exception_list=_nest_allowed_symbols)
remove_undocumented(__name__, allowed_exception_list=_allowed_symbols)

View File

@ -13,7 +13,10 @@
# limitations under the License.
# ==============================================================================
"""Apply graph_transforms tool to MetaGraphDefs."""
"""Apply graph_transforms tool to MetaGraphDefs.
@@meta_graph_transform
"""
from __future__ import absolute_import
from __future__ import division

View File

@ -120,31 +120,9 @@ from tensorflow.python.platform import resource_loader
from tensorflow.python.platform import sysconfig
from tensorflow.python.platform import test
from tensorflow.python.util.all_util import remove_undocumented
from tensorflow.python.util.all_util import make_all
from tensorflow.python.util.tf_export import tf_export
# Import modules whose docstrings contribute, for use by remove_undocumented
# below.
from tensorflow.python.client import client_lib
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import framework_lib
from tensorflow.python.framework import subscribe
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import check_ops
from tensorflow.python.ops import confusion_matrix as confusion_matrix_m
from tensorflow.python.ops import control_flow_ops
from tensorflow.python.ops import functional_ops
from tensorflow.python.ops import histogram_ops
from tensorflow.python.ops import io_ops
from tensorflow.python.ops import math_ops
from tensorflow.python.ops import script_ops
from tensorflow.python.ops import session_ops
from tensorflow.python.ops import sparse_ops
from tensorflow.python.ops import state_ops
from tensorflow.python.ops import string_ops
from tensorflow.python.ops import tensor_array_ops
# Eager execution
from tensorflow.python.eager.context import executing_eagerly
from tensorflow.python.framework.ops import enable_eager_execution
@ -163,35 +141,6 @@ nn.bidirectional_dynamic_rnn = rnn.bidirectional_dynamic_rnn
nn.static_state_saving_rnn = rnn.static_state_saving_rnn
nn.rnn_cell = rnn_cell
# Symbols whitelisted for export without documentation.
# TODO(cwhipkey): review these and move to contrib, expose through
# documentation, or remove.
_allowed_symbols = [
'AttrValue',
'ConfigProto',
'ClusterDef',
'DeviceSpec',
'Event',
'GPUOptions',
'GRAPH_DEF_VERSION',
'GRAPH_DEF_VERSION_MIN_CONSUMER',
'GRAPH_DEF_VERSION_MIN_PRODUCER',
'GraphDef',
'GraphOptions',
'HistogramProto',
'LogMessage',
'MetaGraphDef',
'NameAttrList',
'NodeDef',
'OptimizerOptions',
'RunOptions',
'RunMetadata',
'SessionLog',
'Summary',
'SummaryMetadata',
'TensorInfo', # Used for tf.saved_model functionality.
]
# Export protos
# pylint: disable=undefined-variable
tf_export('AttrValue')(AttrValue)
@ -216,121 +165,6 @@ tf_export('summary.TaggedRunMetadata')(TaggedRunMetadata)
tf_export('TensorInfo')(TensorInfo)
# pylint: enable=undefined-variable
# The following symbols are kept for compatibility. It is our plan
# to remove them in the future.
_allowed_symbols.extend([
'arg_max',
'arg_min',
'create_partitioned_variables',
'deserialize_many_sparse',
'lin_space',
'listdiff', # Use tf.listdiff instead.
'parse_single_sequence_example',
'serialize_many_sparse',
'serialize_sparse',
'sparse_matmul', ## use tf.matmul instead.
])
# This is needed temporarily because we import it explicitly.
_allowed_symbols.extend([
'pywrap_tensorflow',
])
# Dtypes exported by framework/dtypes.py.
# TODO(cwhipkey): expose these through documentation.
_allowed_symbols.extend([
'QUANTIZED_DTYPES',
'bfloat16',
'bool',
'complex64',
'complex128',
'double',
'half',
'float16',
'float32',
'float64',
'int16',
'int32',
'int64',
'int8',
'qint16',
'qint32',
'qint8',
'quint16',
'quint8',
'string',
'uint64',
'uint32',
'uint16',
'uint8',
'resource',
'variant',
])
# Export modules and constants.
_allowed_symbols.extend([
'app',
'bitwise',
'compat',
'data',
'distributions',
'errors',
'estimator',
'feature_column',
'flags',
'gfile',
'graph_util',
'image',
'initializers',
'keras',
'layers',
'linalg',
'logging',
'losses',
'manip',
'metrics',
'newaxis',
'nn',
'profiler',
'python_io',
'resource_loader',
'saved_model',
'sets',
'spectral',
'summary',
'sysconfig',
'test',
'train',
'user_ops',
])
# Variables framework.versions:
_allowed_symbols.extend([
'VERSION',
'GIT_VERSION',
'COMPILER_VERSION',
'CXX11_ABI_FLAG',
'MONOLITHIC_BUILD',
])
# Eager execution
_allowed_symbols.extend([
'enable_eager_execution',
'executing_eagerly',
])
# Remove all extra symbols that don't have a docstring or are not explicitly
# referenced in the whitelist.
remove_undocumented(__name__, _allowed_symbols, [
framework_lib, array_ops, check_ops, client_lib, compat, constant_op,
control_flow_ops, confusion_matrix_m, data, distributions,
functional_ops, histogram_ops, io_ops, keras, layers,
losses, math_ops, metrics, nn, profiler, resource_loader, sets, script_ops,
session_ops, sparse_ops, state_ops, string_ops, summary, tensor_array_ops,
train
])
# Special dunders that we choose to export:
_exported_dunders = set([
'__version__',

View File

@ -34,6 +34,3 @@ from tensorflow.python.data.ops.readers import FixedLengthRecordDataset
from tensorflow.python.data.ops.readers import TextLineDataset
from tensorflow.python.data.ops.readers import TFRecordDataset
# pylint: enable=unused-import
from tensorflow.python.util.all_util import remove_undocumented
remove_undocumented(__name__)

View File

@ -44,7 +44,6 @@ import collections as _collections
import six as _six
from tensorflow.python.framework import sparse_tensor as _sparse_tensor
from tensorflow.python.util.all_util import remove_undocumented
def _sorted(dict_):
@ -538,16 +537,3 @@ def map_structure_up_to(shallow_tree, func, *inputs):
results = [func(*tensors) for tensors in zip(*all_flattened_up_to)]
return pack_sequence_as(structure=shallow_tree, flat_sequence=results)
_allowed_symbols = [
"assert_same_structure",
"is_sequence",
"flatten",
"pack_sequence_as",
"map_structure",
"assert_shallow_structure",
"flatten_up_to",
"map_structure_up_to",
]
remove_undocumented(__name__, _allowed_symbols)

View File

@ -47,45 +47,4 @@ from tensorflow.python.estimator.training import train_and_evaluate
from tensorflow.python.estimator.training import TrainSpec
from tensorflow.python.util.all_util import remove_undocumented
# pylint: enable=unused-import,line-too-long,wildcard-import
_allowed_symbols = [
# Canned Estimators
'BaselineClassifier',
'BaselineRegressor',
'BoostedTreesClassifier',
'BoostedTreesRegressor',
'DNNClassifier',
'DNNRegressor',
'DNNLinearCombinedClassifier',
'DNNLinearCombinedRegressor',
'LinearClassifier',
'LinearRegressor',
# I/O
'classifier_parse_example_spec',
'regressor_parse_example_spec',
'inputs',
'export',
# Estimator
'Estimator',
'EstimatorSpec',
'ModeKeys',
'RunConfig',
# Training utilities
'train_and_evaluate',
'EvalSpec',
'TrainSpec',
'Exporter',
'LatestExporter',
'FinalExporter',
# Warm-starting
'WarmStartSettings',
'VocabInfo',
]
remove_undocumented(__name__, allowed_exception_list=_allowed_symbols)

View File

@ -28,18 +28,5 @@ from tensorflow.python.estimator.export.export_output import ExportOutput
from tensorflow.python.estimator.export.export_output import PredictOutput
from tensorflow.python.estimator.export.export_output import RegressionOutput
from tensorflow.python.util.all_util import remove_undocumented
# pylint: enable=unused-import,line-too-long
_allowed_symbols = [
'build_parsing_serving_input_receiver_fn',
'build_raw_serving_input_receiver_fn',
'ServingInputReceiver',
'TensorServingInputReceiver',
'ClassificationOutput',
'ExportOutput',
'PredictOutput',
'RegressionOutput',
]
remove_undocumented(__name__, allowed_exception_list=_allowed_symbols)

View File

@ -22,12 +22,4 @@ from __future__ import print_function
from tensorflow.python.estimator.inputs.numpy_io import numpy_input_fn
from tensorflow.python.estimator.inputs.pandas_io import pandas_input_fn
from tensorflow.python.util.all_util import remove_undocumented
# pylint: enable=unused-import,line-too-long
_allowed_symbols = [
'numpy_input_fn',
'pandas_input_fn'
]
remove_undocumented(__name__, allowed_exception_list=_allowed_symbols)

View File

@ -20,25 +20,4 @@ from __future__ import print_function
# pylint: disable=unused-import,line-too-long,wildcard-import
from tensorflow.python.feature_column.feature_column import *
from tensorflow.python.util.all_util import remove_undocumented
# pylint: enable=unused-import,line-too-long
_allowed_symbols = [
'input_layer',
'linear_model',
'make_parse_example_spec',
'embedding_column',
'shared_embedding_columns',
'crossed_column',
'numeric_column',
'bucketized_column',
'categorical_column_with_hash_bucket',
'categorical_column_with_vocabulary_file',
'categorical_column_with_vocabulary_list',
'categorical_column_with_identity',
'weighted_categorical_column',
'indicator_column',
]
remove_undocumented(__name__, allowed_exception_list=_allowed_symbols)

View File

@ -25,50 +25,4 @@ from tensorflow.python.framework import errors_impl as _impl
# pylint: disable=wildcard-import
from tensorflow.python.framework.errors_impl import *
# pylint: enable=wildcard-import
from tensorflow.python.util.all_util import remove_undocumented
# These are referenced in client/client_lib.py.
# Unfortunately, we can't import client_lib to examine
# the references, since it would create a dependency cycle.
_allowed_symbols = [
"AbortedError",
"AlreadyExistsError",
"CancelledError",
"DataLossError",
"DeadlineExceededError",
"FailedPreconditionError",
"InternalError",
"InvalidArgumentError",
"NotFoundError",
"OpError",
"OutOfRangeError",
"PermissionDeniedError",
"ResourceExhaustedError",
"UnauthenticatedError",
"UnavailableError",
"UnimplementedError",
"UnknownError",
"error_code_from_exception_type",
"exception_type_from_error_code",
"raise_exception_on_not_ok_status",
# Scalars that have no docstrings:
"OK",
"CANCELLED",
"UNKNOWN",
"INVALID_ARGUMENT",
"DEADLINE_EXCEEDED",
"NOT_FOUND",
"ALREADY_EXISTS",
"PERMISSION_DENIED",
"UNAUTHENTICATED",
"RESOURCE_EXHAUSTED",
"FAILED_PRECONDITION",
"ABORTED",
"OUT_OF_RANGE",
"UNIMPLEMENTED",
"INTERNAL",
"UNAVAILABLE",
"DATA_LOSS",
]
remove_undocumented(__name__, _allowed_symbols)

View File

@ -28,14 +28,3 @@ from tensorflow.python.framework.graph_util_impl import must_run_on_cpu
from tensorflow.python.framework.graph_util_impl import remove_training_nodes
from tensorflow.python.framework.graph_util_impl import tensor_shape_from_node_def_name
# pylint: enable=unused-import
from tensorflow.python.util.all_util import remove_undocumented
_allowed_symbols = [
# TODO(drpng): find a good place to reference this.
"convert_variables_to_constants",
"extract_sub_graph",
"must_run_on_cpu",
"tensor_shape_from_node_def_name",
"remove_training_nodes",
]
remove_undocumented(__name__, _allowed_symbols)

View File

@ -61,8 +61,6 @@ from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.util.all_util import remove_undocumented
# pylint: disable=g-bad-import-order,unused-import
# Base objects.
@ -122,7 +120,3 @@ from tensorflow.python.layers.normalization import BatchNormalization
from tensorflow.python.layers.normalization import batch_normalization
# pylint: enable=g-bad-import-order,unused-import
_allowed_symbols = []
remove_undocumented(__name__, _allowed_symbols)

View File

@ -31,8 +31,3 @@ from __future__ import print_function
# pylint: disable=wildcard-import
from tensorflow.python.lib.io.tf_record import *
# pylint: enable=wildcard-import
from tensorflow.python.util.all_util import remove_undocumented
_allowed_symbols = []
remove_undocumented(__name__, _allowed_symbols)

View File

@ -32,7 +32,6 @@ from tensorflow.python.framework import ops
# pylint: disable=wildcard-import
from tensorflow.python.ops.gen_bitwise_ops import *
# pylint: enable=wildcard-import
from tensorflow.python.util.all_util import remove_undocumented
ops.NotDifferentiable("BitwiseAnd")
ops.NotDifferentiable("BitwiseOr")
@ -41,5 +40,3 @@ ops.NotDifferentiable("Invert")
ops.NotDifferentiable("PopulationCount")
ops.NotDifferentiable("LeftShift")
ops.NotDifferentiable("RightShift")
remove_undocumented(__name__)

View File

@ -23,8 +23,3 @@ from __future__ import print_function
from tensorflow.python.ops.distributions.bijector_impl import Bijector
# pylint: enable=wildcard-import,unused-import
from tensorflow.python.util.all_util import remove_undocumented
_allowed_symbols = ["Bijector"]
remove_undocumented(__name__, _allowed_symbols)

View File

@ -35,29 +35,3 @@ from tensorflow.python.ops.distributions.student_t import StudentT
from tensorflow.python.ops.distributions.uniform import Uniform
# pylint: enable=wildcard-import,unused-import
from tensorflow.python.util.all_util import remove_undocumented
_allowed_symbols = [
"Bernoulli",
"Beta",
"Categorical",
"DirichletMultinomial",
"Dirichlet",
"Distribution",
"ReparameterizationType",
"FULLY_REPARAMETERIZED",
"NOT_REPARAMETERIZED",
"Exponential",
"Gamma",
"RegisterKL",
"kl_divergence",
"Laplace",
"Multinomial",
"Normal",
"StudentT",
"Uniform",
]
remove_undocumented(__name__, _allowed_symbols)

View File

@ -19,8 +19,6 @@ from __future__ import print_function
import numpy as np
# Bijectors must be directly imported because `remove_undocumented` prevents
# individual file imports.
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops

View File

@ -25,14 +25,4 @@ from tensorflow.python.ops.gradients_impl import AggregationMethod
from tensorflow.python.ops.gradients_impl import gradients
from tensorflow.python.ops.gradients_impl import hessians
# pylint: enable=unused-import
from tensorflow.python.util.all_util import remove_undocumented
_allowed_symbols = [
# TODO(drpng): find a good place to reference this.
"AggregationMethod",
"GradientTape",
"custom_gradient",
"gradients", # tf.gradients.gradients.
"hessians", # tf.gradients.hessians
]
remove_undocumented(__name__, _allowed_symbols)

View File

@ -91,13 +91,3 @@ from tensorflow.python.ops.image_ops_impl import *
from tensorflow.python.ops.image_ops_impl import _Check3DImage
from tensorflow.python.ops.image_ops_impl import _ImageDimensions
# pylint: enable=unused-import
from tensorflow.python.util.all_util import remove_undocumented
_allowed_symbols = [
# ResizeMethod is not documented, but is documented in functions
# that use it.
'ResizeMethod',
]
remove_undocumented(__name__, _allowed_symbols)

View File

@ -35,16 +35,7 @@ from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
from tensorflow.python.ops.losses import util
# pylint: disable=wildcard-import
from tensorflow.python.ops.losses.losses_impl import *
from tensorflow.python.ops.losses.util import *
# pylint: enable=wildcard-import
from tensorflow.python.util.all_util import remove_undocumented
_allowed_symbols = []
remove_undocumented(__name__, _allowed_symbols,
[sys.modules[__name__], util])

View File

@ -22,7 +22,6 @@ from __future__ import division
from __future__ import print_function
from tensorflow.python.ops import gen_manip_ops as _gen_manip_ops
from tensorflow.python.util.all_util import remove_undocumented
from tensorflow.python.util.tf_export import tf_export
@ -34,7 +33,3 @@ def roll(input, shift, axis): # pylint: disable=redefined-builtin
roll.__doc__ = _gen_manip_ops.roll.__doc__
# pylint: enable=protected-access
_allowed_symbols = ['roll']
remove_undocumented(__name__, allowed_exception_list=_allowed_symbols)

View File

@ -58,8 +58,3 @@ from __future__ import print_function
# pylint: disable=wildcard-import
from tensorflow.python.ops.metrics_impl import *
# pylint: enable=wildcard-import
from tensorflow.python.util.all_util import remove_undocumented
_allowed_symbols = []
remove_undocumented(__name__, _allowed_symbols)

View File

@ -117,7 +117,6 @@ from tensorflow.python.ops import nn_ops as _nn_ops
from tensorflow.python.ops.math_ops import sigmoid
from tensorflow.python.ops.math_ops import tanh
# pylint: enable=unused-import
from tensorflow.python.util.all_util import remove_undocumented
# Bring more nn-associated functionality into this package.
# go/tf-wildcard-import
@ -128,22 +127,3 @@ from tensorflow.python.ops.nn_ops import *
from tensorflow.python.ops.candidate_sampling_ops import *
from tensorflow.python.ops.embedding_ops import *
# pylint: enable=wildcard-import,unused-import
# TODO(cwhipkey): sigmoid and tanh should not be exposed from tf.nn.
_allowed_symbols = [
"zero_fraction", # documented in training.py
# Modules whitelisted for reference through tf.nn.
# TODO(cwhipkey): migrate callers to use the submodule directly.
# Symbols whitelisted for export without documentation.
# TODO(cwhipkey): review these and move to contrib or expose through
# documentation.
"all_candidate_sampler", # Excluded in gen_docs_combined.
"lrn", # Excluded in gen_docs_combined.
"relu_layer", # Excluded in gen_docs_combined.
"xw_plus_b", # Excluded in gen_docs_combined.
"rnn_cell", # rnn_cell is a submodule of tf.nn.
]
remove_undocumented(__name__, _allowed_symbols,
[_sys.modules[__name__], _ctc_ops, _nn_ops, _nn_grad])

View File

@ -44,8 +44,3 @@ from __future__ import print_function
# pylint: disable=wildcard-import
from tensorflow.python.ops.rnn_cell_impl import *
# pylint: enable=wildcard-import
from tensorflow.python.util.all_util import remove_undocumented
_allowed_symbols = []
remove_undocumented(__name__, _allowed_symbols)

View File

@ -31,11 +31,6 @@ from tensorflow.python.framework import ops
from tensorflow.python.ops.gen_sdca_ops import *
# pylint: enable=wildcard-import
from tensorflow.python.util.all_util import remove_undocumented
ops.NotDifferentiable("SdcaFprint")
ops.NotDifferentiable("SdcaOptimizer")
ops.NotDifferentiable("SdcaShrinkL1")
remove_undocumented(__name__)

View File

@ -28,8 +28,3 @@ from __future__ import print_function
# pylint: disable=wildcard-import
from tensorflow.python.ops.sets_impl import *
# pylint: enable=wildcard-import
from tensorflow.python.util.all_util import remove_undocumented
_allowed_symbols = []
remove_undocumented(__name__, _allowed_symbols)

View File

@ -40,7 +40,6 @@ from tensorflow.python.framework import tensor_util as _tensor_util
from tensorflow.python.ops import array_ops as _array_ops
from tensorflow.python.ops import gen_spectral_ops
from tensorflow.python.ops import math_ops as _math_ops
from tensorflow.python.util.all_util import remove_undocumented
from tensorflow.python.util.tf_export import tf_export
@ -249,5 +248,3 @@ def dct(input, type=2, n=None, axis=-1, norm=None, name=None): # pylint: disabl
dct2 *= weights
return dct2
remove_undocumented(__name__)

View File

@ -33,7 +33,6 @@ from tensorflow.python.ops import sparse_grad
from tensorflow.python.ops import spectral_grad
from tensorflow.python.ops import state_grad
from tensorflow.python.ops import tensor_array_grad
from tensorflow.python.util.all_util import remove_undocumented
# go/tf-wildcard-import
@ -99,212 +98,3 @@ from tensorflow.python.ops.variables import *
# pylint: enable=wildcard-import
# pylint: enable=g-bad-import-order
#### For use in remove_undocumented below:
from tensorflow.python.framework import constant_op as _constant_op
from tensorflow.python.ops import array_ops as _array_ops
from tensorflow.python.ops import check_ops as _check_ops
from tensorflow.python.ops import clip_ops as _clip_ops
from tensorflow.python.ops import confusion_matrix as _confusion_matrix
from tensorflow.python.ops import control_flow_ops as _control_flow_ops
from tensorflow.python.ops import data_flow_ops as _data_flow_ops
from tensorflow.python.ops import functional_ops as _functional_ops
from tensorflow.python.ops import gradients as _gradients
from tensorflow.python.ops import histogram_ops as _histogram_ops
from tensorflow.python.ops import init_ops as _init_ops
from tensorflow.python.ops import io_ops as _io_ops
from tensorflow.python.ops import linalg_ops as _linalg_ops
from tensorflow.python.ops import logging_ops as _logging_ops
from tensorflow.python.ops import manip_ops as _manip_ops
from tensorflow.python.ops import math_ops as _math_ops
from tensorflow.python.ops import numerics as _numerics
from tensorflow.python.ops import parsing_ops as _parsing_ops
from tensorflow.python.ops import partitioned_variables as _partitioned_variables
from tensorflow.python.ops import random_ops as _random_ops
from tensorflow.python.ops import script_ops as _script_ops
from tensorflow.python.ops import session_ops as _session_ops
from tensorflow.python.ops import sparse_ops as _sparse_ops
from tensorflow.python.ops import special_math_ops as _special_math_ops
from tensorflow.python.ops import state_ops as _state_ops
from tensorflow.python.ops import string_ops as _string_ops
from tensorflow.python.ops import template as _template
from tensorflow.python.ops import tensor_array_ops as _tensor_array_ops
from tensorflow.python.ops import variable_scope as _variable_scope
from tensorflow.python.ops import variables as _variables
_allowed_symbols_math_ops = [
# TODO(drpng): decide if we want to reference these in the documentation.
"reduced_shape",
"sparse_segment_mean_grad",
"sparse_segment_sqrt_n_grad",
# Legacy: will be removed.
"arg_max",
"arg_min",
"lin_space",
"sparse_matmul", # Use tf.matmul.
# Deprecated (see versions.h):
"batch_fft",
"batch_fft2d",
"batch_fft3d",
"batch_ifft",
"batch_ifft2d",
"batch_ifft3d",
"mul", # use tf.multiply instead.
"neg", # use tf.negative instead.
"sub", # use tf.subtract instead.
# These are documented in nn.
# We are not importing nn because it would create a circular dependency.
"sigmoid",
"log_sigmoid",
"tanh",
]
_allowed_symbols_array_ops = [
# TODO(drpng): make sure they are documented.
# Scalars:
"NEW_AXIS",
"SHRINK_AXIS",
"newaxis",
# Documented in training.py.
# I do not import train, to avoid circular dependencies.
# TODO(drpng): this is defined in gen_array_ops, clearly not the right
# place.
"stop_gradient",
# See gen_docs_combined for tf.copy documentation.
"copy",
## TODO(drpng): make them inaccessible directly.
## TODO(drpng): Below, to-doc means that we need to find an appropriate
## documentation section to reference.
## For re-exporting to tf.*:
"constant",
"edit_distance", # to-doc
# From gen_array_ops:
"copy_host", # to-doc
"immutable_const", # to-doc
"invert_permutation", # to-doc
"quantize_and_dequantize", # to-doc
# TODO(drpng): legacy symbols to be removed.
"batch_matrix_diag",
"batch_matrix_band_part",
"batch_matrix_diag_part",
"batch_matrix_set_diag",
]
_allowed_symbols_partitioned_variables = [
"PartitionedVariable", # Requires doc link.
# Legacy.
"create_partitioned_variables",
"variable_axis_size_partitioner",
"min_max_variable_partitioner",
"fixed_size_partitioner",
]
_allowed_symbols_control_flow_ops = [
# TODO(drpng): Find a place in the documentation to reference these or
# remove.
"control_trigger",
"loop_cond",
"merge",
"switch",
]
_allowed_symbols_functional_ops = [
"nest", # Used by legacy code.
]
_allowed_symbols_gradients = [
# Documented in training.py:
# Not importing training.py to avoid complex graph dependencies.
"AggregationMethod",
"GradientTape",
"custom_gradient",
"gradients", # tf.gradients = gradients.gradients
"hessians",
]
_allowed_symbols_clip_ops = [
# Documented in training.py:
# Not importing training.py to avoid complex graph dependencies.
"clip_by_average_norm",
"clip_by_global_norm",
"clip_by_norm",
"clip_by_value",
"global_norm",
]
_allowed_symbols_logging_ops = [
# Documented in training.py.
# We are not importing training.py to avoid complex dependencies.
"audio_summary",
"histogram_summary",
"image_summary",
"merge_all_summaries",
"merge_summary",
"scalar_summary",
# TODO(drpng): link in training.py if it should be documented.
"get_summary_op",
]
_allowed_symbols_variable_scope_ops = [
"get_local_variable", # Documented in framework package.
]
_allowed_symbols_misc = [
"deserialize_many_sparse",
"parse_single_sequence_example",
"serialize_many_sparse",
"serialize_sparse",
"confusion_matrix",
]
_allowed_symbols = (_allowed_symbols_array_ops +
_allowed_symbols_clip_ops +
_allowed_symbols_control_flow_ops +
_allowed_symbols_functional_ops +
_allowed_symbols_gradients +
_allowed_symbols_logging_ops +
_allowed_symbols_math_ops +
_allowed_symbols_variable_scope_ops +
_allowed_symbols_misc +
_allowed_symbols_partitioned_variables)
remove_undocumented(__name__, _allowed_symbols, [
_sys.modules[__name__],
_array_ops,
_check_ops,
_clip_ops,
_confusion_matrix,
_control_flow_ops,
_constant_op,
_data_flow_ops,
_functional_ops,
_gradients,
_histogram_ops,
_init_ops,
_io_ops,
_linalg_ops,
_logging_ops,
_manip_ops,
_math_ops,
_numerics,
_parsing_ops,
_partitioned_variables,
_random_ops,
_script_ops,
_session_ops,
_sparse_ops,
_special_math_ops,
_state_ops,
_string_ops,
_template,
_tensor_array_ops,
_variable_scope,
_variables,
])

View File

@ -22,7 +22,6 @@ import errno as _errno
import sys as _sys
from tensorflow.python.platform import flags
from tensorflow.python.util.all_util import remove_undocumented
from tensorflow.python.util.tf_export import tf_export
@ -125,11 +124,3 @@ def run(main=None, argv=None):
# to the final program.
_sys.exit(main(argv))
_allowed_symbols = [
'run',
# Allowed submodule.
'flags',
]
remove_undocumented(__name__, _allowed_symbols)

View File

@ -33,7 +33,6 @@ from tensorflow.python.lib.io.file_io import rename as Rename
from tensorflow.python.lib.io.file_io import stat as Stat
from tensorflow.python.lib.io.file_io import walk as Walk
# pylint: enable=unused-import
from tensorflow.python.util.all_util import remove_undocumented
from tensorflow.python.util.tf_export import tf_export
@ -56,24 +55,3 @@ class FastGFile(_FileIO):
# Does not alias to Open so that we use our version of GFile to strip
# 'b' mode.
Open = GFile
# TODO(drpng): Find the right place to document these.
_allowed_symbols = [
'Copy',
'DeleteRecursively',
'Exists',
'FastGFile',
'GFile',
'Glob',
'IsDirectory',
'ListDirectory',
'Open',
'MakeDirs',
'MkDir',
'Remove',
'Rename',
'Stat',
'Walk',
]
remove_undocumented(__name__, _allowed_symbols)

View File

@ -28,7 +28,6 @@ import os as _os
import sys as _sys
from tensorflow.python.util import tf_inspect as _inspect
from tensorflow.python.util.all_util import remove_undocumented
from tensorflow.python.util.tf_export import tf_export
@ -129,7 +128,3 @@ def get_path_to_datafile(path):
def readahead_file_path(path, readahead='128M'): # pylint: disable=unused-argument
"""Readahead files not implemented; simply returns given path."""
return path
_allowed_symbols = []
remove_undocumented(__name__, _allowed_symbols)

View File

@ -28,7 +28,6 @@ import os.path as _os_path
from tensorflow.python.framework.versions import CXX11_ABI_FLAG as _CXX11_ABI_FLAG
from tensorflow.python.framework.versions import MONOLITHIC_BUILD as _MONOLITHIC_BUILD
from tensorflow.python.util.all_util import remove_undocumented
from tensorflow.python.util.tf_export import tf_export
@ -84,6 +83,3 @@ def get_link_flags():
flags.append('-L%s' % get_lib())
flags.append('-ltensorflow_framework')
return flags
_allowed_symbols = []
remove_undocumented(__name__, _allowed_symbols)

View File

@ -42,7 +42,6 @@ from __future__ import print_function
# pylint: disable=g-bad-import-order
from tensorflow.python.framework import test_util as _test_util
from tensorflow.python.platform import googletest as _googletest
from tensorflow.python.util.all_util import remove_undocumented
# pylint: disable=unused-import
from tensorflow.python.framework.test_util import assert_equal_graph_def
@ -108,13 +107,3 @@ def test_src_dir_path(relative_path):
def is_built_with_cuda():
"""Returns whether TensorFlow was built with CUDA (GPU) support."""
return _test_util.IsGoogleCudaEnabled()
_allowed_symbols = [
# We piggy-back googletest documentation.
'Benchmark',
'mock',
'StubOutForTesting',
]
remove_undocumented(__name__, _allowed_symbols)

View File

@ -34,7 +34,6 @@ import threading
import six
from tensorflow.python.util.all_util import remove_undocumented
from tensorflow.python.util.tf_export import tf_export
@ -287,35 +286,8 @@ def _get_thread_id():
_log_prefix = google2_log_prefix
# Controls which methods from pyglib.logging are available within the project.
# Do not add methods here without also adding to platform/tf_logging.py.
_allowed_symbols = [
'DEBUG',
'ERROR',
'FATAL',
'INFO',
'TaskLevelStatusMessage',
'WARN',
'debug',
'error',
'fatal',
'flush',
'get_verbosity',
'info',
'log',
'log_if',
'log_every_n',
'log_first_n',
'set_verbosity',
'vlog',
'warn',
'warning',
]
tf_export('logging.DEBUG').export_constant(__name__, 'DEBUG')
tf_export('logging.ERROR').export_constant(__name__, 'ERROR')
tf_export('logging.FATAL').export_constant(__name__, 'FATAL')
tf_export('logging.INFO').export_constant(__name__, 'INFO')
tf_export('logging.WARN').export_constant(__name__, 'WARN')
remove_undocumented(__name__, _allowed_symbols)

View File

@ -30,7 +30,6 @@ from tensorflow.python.profiler.model_analyzer import Profiler
from tensorflow.python.profiler.option_builder import ProfileOptionBuilder
from tensorflow.python.profiler.tfprof_logger import write_op_log
from tensorflow.python.util.all_util import remove_undocumented
from tensorflow.python.util.tf_export import tf_export
@ -54,11 +53,3 @@ tf_export('profiler.GraphNodeProto')(GraphNodeProto)
tf_export('profiler.MultiGraphNodeProto')(MultiGraphNodeProto)
tf_export('profiler.AdviceProto')(AdviceProto)
tf_export('profiler.OpLogProto')(OpLogProto)
remove_undocumented(__name__, _allowed_symbols, [
Profiler,
profile,
ProfileOptionBuilder,
advise,
write_op_log,
])

View File

@ -26,10 +26,3 @@ from __future__ import print_function
# pylint: disable=unused-import
from tensorflow.python.saved_model.builder_impl import SavedModelBuilder
# pylint: enable=unused-import
from tensorflow.python.util.all_util import remove_undocumented
_allowed_symbols = [
"SavedModelBuilder",
]
remove_undocumented(__name__, _allowed_symbols)

View File

@ -19,7 +19,6 @@ from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.util.all_util import remove_undocumented
from tensorflow.python.util.tf_export import tf_export
# Subdirectory name containing the asset files.
@ -66,17 +65,3 @@ tf_export("saved_model.constants.VARIABLES_DIRECTORY").export_constant(
VARIABLES_FILENAME = "variables"
tf_export("saved_model.constants.VARIABLES_FILENAME").export_constant(
__name__, "VARIABLES_FILENAME")
_allowed_symbols = [
"ASSETS_DIRECTORY",
"ASSETS_KEY",
"LEGACY_INIT_OP_KEY",
"MAIN_OP_KEY",
"SAVED_MODEL_SCHEMA_VERSION",
"SAVED_MODEL_FILENAME_PB",
"SAVED_MODEL_FILENAME_PBTXT",
"VARIABLES_DIRECTORY",
"VARIABLES_FILENAME",
]
remove_undocumented(__name__, _allowed_symbols)

View File

@ -67,11 +67,3 @@ from __future__ import print_function
from tensorflow.python.saved_model.loader_impl import load
from tensorflow.python.saved_model.loader_impl import maybe_saved_model_directory
# pylint: enable=unused-import
from tensorflow.python.util.all_util import remove_undocumented
_allowed_symbols = [
"load",
"maybe_saved_model_directory",
]
remove_undocumented(__name__, _allowed_symbols)

View File

@ -26,10 +26,3 @@ from __future__ import print_function
from tensorflow.python.saved_model.main_op_impl import main_op
from tensorflow.python.saved_model.main_op_impl import main_op_with_restore
# pylint: enable=unused-import
from tensorflow.python.util.all_util import remove_undocumented
_allowed_symbols = [
"main_op",
"main_op_with_restore",
]
remove_undocumented(__name__, _allowed_symbols)

View File

@ -34,18 +34,3 @@ from tensorflow.python.saved_model import utils
from tensorflow.python.saved_model.simple_save import *
# pylint: enable=wildcard-import
from tensorflow.python.util.all_util import remove_undocumented
_allowed_symbols = [
"builder",
"constants",
"loader",
"main_op",
"signature_constants",
"signature_def_utils",
"simple_save",
"tag_constants",
"utils",
]
remove_undocumented(__name__, _allowed_symbols)

View File

@ -19,7 +19,6 @@ from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.util.all_util import remove_undocumented
from tensorflow.python.util.tf_export import tf_export
@ -95,19 +94,3 @@ tf_export("saved_model.signature_constants.REGRESS_OUTPUTS").export_constant(
__name__, "REGRESS_OUTPUTS")
################################################################################
_allowed_symbols = [
"DEFAULT_SERVING_SIGNATURE_DEF_KEY",
"CLASSIFY_INPUTS",
"CLASSIFY_METHOD_NAME",
"CLASSIFY_OUTPUT_CLASSES",
"CLASSIFY_OUTPUT_SCORES",
"PREDICT_INPUTS",
"PREDICT_METHOD_NAME",
"PREDICT_OUTPUTS",
"REGRESS_INPUTS",
"REGRESS_METHOD_NAME",
"REGRESS_OUTPUTS",
]
remove_undocumented(__name__, _allowed_symbols)

View File

@ -19,7 +19,6 @@ from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.util.all_util import remove_undocumented
from tensorflow.python.util.tf_export import tf_export
@ -40,11 +39,3 @@ tf_export("saved_model.tag_constants.GPU").export_constant(__name__, "GPU")
# Tag for the `tpu` graph.
TPU = "tpu"
tf_export("saved_model.tag_constants.TPU").export_constant(__name__, "TPU")
_allowed_symbols = [
"SERVING",
"TRAINING",
"GPU",
"TPU"
]
remove_undocumented(__name__, _allowed_symbols)

View File

@ -24,7 +24,3 @@ from __future__ import print_function
from tensorflow.python.saved_model.utils_impl import build_tensor_info
from tensorflow.python.saved_model.utils_impl import get_tensor_from_tensor_info
# pylint: enable=unused-import
from tensorflow.python.util.all_util import remove_undocumented
_allowed_symbols = ["build_tensor_info", "get_tensor_from_tensor_info"]
remove_undocumented(__name__, _allowed_symbols)

View File

@ -74,7 +74,6 @@ from tensorflow.python.summary.writer.writer_cache import FileWriterCache
# pylint: enable=unused-import
from tensorflow.python.util import compat as _compat
from tensorflow.python.util.all_util import remove_undocumented
from tensorflow.python.util.tf_export import tf_export
@ -361,10 +360,3 @@ def get_summary_description(node_def):
summary_description = SummaryDescription()
_json_format.Parse(description_str, summary_description)
return summary_description
_allowed_symbols = [
'Summary', 'SummaryDescription', 'Event', 'TaggedRunMetadata', 'SessionLog',
]
remove_undocumented(__name__, _allowed_symbols)

View File

@ -22,13 +22,3 @@ from __future__ import print_function
# pylint: disable=wildcard-import
from tensorflow.python.training.queue_runner_impl import *
# pylint: enable=wildcard-import
from tensorflow.python.util.all_util import remove_undocumented
_allowed_symbols = [
# Documented in training.py:
"QueueRunner",
"add_queue_runner",
"start_queue_runners",
]
remove_undocumented(__name__, _allowed_symbols)

View File

@ -105,13 +105,6 @@ from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys as _sys
from tensorflow.python.ops import io_ops as _io_ops
from tensorflow.python.ops import sdca_ops as _sdca_ops
from tensorflow.python.ops import state_ops as _state_ops
from tensorflow.python.util.all_util import remove_undocumented
# pylint: disable=g-bad-import-order,unused-import
from tensorflow.python.ops.sdca_ops import sdca_optimizer
from tensorflow.python.ops.sdca_ops import sdca_fprint
@ -215,39 +208,6 @@ from tensorflow.core.protobuf.tensorflow_server_pb2 import ServerDef
from tensorflow.python.training.server_lib import ClusterSpec
from tensorflow.python.training.server_lib import Server
# Symbols whitelisted for export without documentation.
_allowed_symbols = [
# TODO(cwhipkey): review these and move to contrib or expose through
# documentation.
"generate_checkpoint_state_proto", # Used internally by saver.
"checkpoint_exists", # Only used in test?
"get_checkpoint_mtimes", # Only used in test?
# Legacy: remove.
"do_quantize_training_on_graphdef", # At least use grah_def, not graphdef.
# No uses within tensorflow.
"queue_runner", # Use tf.train.start_queue_runner etc directly.
# This is also imported internally.
# TODO(drpng): document these. The reference in howtos/distributed does
# not link.
"SyncReplicasOptimizer",
# Protobufs:
"BytesList", # from example_pb2.
"ClusterDef",
"Example", # from example_pb2
"Feature", # from example_pb2
"Features", # from example_pb2
"FeatureList", # from example_pb2
"FeatureLists", # from example_pb2
"FloatList", # from example_pb2.
"Int64List", # from example_pb2.
"JobDef",
"SaverDef", # From saver_pb2.
"SequenceExample", # from example_pb2.
"ServerDef",
]
# pylint: disable=undefined-variable
tf_export("train.BytesList")(BytesList)
tf_export("train.ClusterDef")(ClusterDef)
@ -263,9 +223,3 @@ tf_export("train.SaverDef")(SaverDef)
tf_export("train.SequenceExample")(SequenceExample)
tf_export("train.ServerDef")(ServerDef)
# pylint: enable=undefined-variable
# Include extra modules for docstrings because:
# * Input methods in tf.train are documented in io_ops.
# * Saver methods in tf.train are documented in state_ops.
remove_undocumented(__name__, _allowed_symbols,
[_sys.modules[__name__], _io_ops, _sdca_ops, _state_ops])

View File

@ -40,7 +40,6 @@ import numbers as _numbers
import numpy as _np
import six as _six
from tensorflow.python.util.all_util import remove_undocumented
from tensorflow.python.util.tf_export import tf_export
@ -142,13 +141,3 @@ tf_export('compat.complex_types').export_constant(__name__, 'complex_types')
bytes_or_text_types = (bytes, _six.text_type)
tf_export('compat.bytes_or_text_types').export_constant(__name__,
'bytes_or_text_types')
_allowed_symbols = [
'as_str',
'bytes_or_text_types',
'complex_types',
'integral_types',
'real_types',
]
remove_undocumented(__name__, _allowed_symbols)

View File

@ -36,7 +36,6 @@ import collections as _collections
import six as _six
from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow
from tensorflow.python.util.all_util import remove_undocumented
def _sorted(dict_):
@ -758,21 +757,3 @@ def flatten_with_joined_string_paths(structure, separator="/"):
_pywrap_tensorflow.RegisterSequenceClass(_collections.Sequence)
_allowed_symbols = [
"assert_same_structure",
"is_sequence",
"flatten",
"flatten_dict_items",
"pack_sequence_as",
"map_structure",
"assert_shallow_structure",
"flatten_up_to",
"map_structure_up_to",
"get_traverse_shallow_structure",
"yield_flat_paths",
"flatten_with_joined_string_paths",
]
remove_undocumented(__name__, _allowed_symbols)