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:
parent
82d27b8386
commit
d82a2bbf8a
tensorflow
@ -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
|
||||
|
@ -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
|
||||
|
@ -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')
|
||||
|
||||
|
@ -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',
|
||||
],
|
||||
|
Loading…
Reference in New Issue
Block a user