|
120 | 120 | from tensorflow.python.platform import sysconfig |
121 | 121 | from tensorflow.python.platform import test |
122 | 122 |
|
123 | | -from tensorflow.python.util.all_util import remove_undocumented |
124 | 123 | from tensorflow.python.util.all_util import make_all |
125 | 124 | from tensorflow.python.util.tf_export import tf_export |
126 | 125 |
|
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 | | - |
148 | 126 | # Eager execution |
149 | 127 | from tensorflow.python.eager.context import executing_eagerly |
150 | 128 | from tensorflow.python.framework.ops import enable_eager_execution |
|
163 | 141 | nn.static_state_saving_rnn = rnn.static_state_saving_rnn |
164 | 142 | nn.rnn_cell = rnn_cell |
165 | 143 |
|
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 | | - |
195 | 144 | # Export protos |
196 | 145 | # pylint: disable=undefined-variable |
197 | 146 | tf_export('AttrValue')(AttrValue) |
|
216 | 165 | tf_export('TensorInfo')(TensorInfo) |
217 | 166 | # pylint: enable=undefined-variable |
218 | 167 |
|
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 | | - |
334 | 168 | # Special dunders that we choose to export: |
335 | 169 | _exported_dunders = set([ |
336 | 170 | '__version__', |
|
0 commit comments