Remove non-public module removals from api_template files. Instead, these

deletions are now applied in virtual_root_template.

PiperOrigin-RevId: 267071525
This commit is contained in:
Anna R 2019-09-03 20:22:26 -07:00 committed by TensorFlower Gardener
parent 82d27b8386
commit d82a2bbf8a
4 changed files with 6 additions and 42 deletions

View File

@ -125,25 +125,6 @@ if _running_from_pip_package():
if _fi.file_exists(plugin_dir):
_ll.load_library(plugin_dir)
# These symbols appear because we import the python package which
# in turn imports from tensorflow.core and tensorflow.python. They
# must come from this module. So python adds these symbols for the
# resolution to succeed.
# pylint: disable=undefined-variable
try:
del python
except NameError:
pass
try:
del core
except NameError:
pass
try:
del compiler
except NameError:
pass
# pylint: enable=undefined-variable
# Add module aliases
if hasattr(_current_module, 'keras'):
losses = keras.losses

View File

@ -138,22 +138,3 @@ if _running_from_pip_package():
if _fi.file_exists(plugin_dir):
_ll.load_library(plugin_dir)
# These symbols appear because we import the python package which
# in turn imports from tensorflow.core and tensorflow.python. They
# must come from this module. So python adds these symbols for the
# resolution to succeed.
# pylint: disable=undefined-variable
try:
del python
except NameError:
pass
try:
del core
except NameError:
pass
try:
del compiler
except NameError:
pass
# pylint: enable=undefined-variable

View File

@ -314,7 +314,7 @@ class ApiCompatibilityTest(test.TestCase):
visitor = python_object_to_proto_visitor.PythonObjectToProtoVisitor()
public_api_visitor = public_api.PublicAPIVisitor(visitor)
public_api_visitor.private_map['tf'] = ['contrib']
public_api_visitor.private_map['tf'].append('contrib')
if api_version == 2:
public_api_visitor.private_map['tf'].append('enable_v2_behavior')

View File

@ -40,6 +40,11 @@ class PublicAPIVisitor(object):
# Modules/classes we want to suppress entirely.
self._private_map = {
'tf': [
'compiler',
'core',
'python',
],
# Some implementations have this internal module that we shouldn't
# expose.
'tf.flags': ['cpp_flags'],
@ -50,8 +55,6 @@ class PublicAPIVisitor(object):
# Each entry maps a module path to a name to ignore in traversal.
self._do_not_descend_map = {
'tf': [
'compiler',
'core',
'examples',
'flags', # Don't add flags
# TODO(drpng): This can be removed once sealed off.
@ -60,7 +63,6 @@ class PublicAPIVisitor(object):
'pywrap_tensorflow',
# TODO(drpng): This can be removed once sealed.
'user_ops',
'python',
'tools',
'tensorboard',
],