diff --git a/tensorflow/__init__.py b/tensorflow/__init__.py index 21677512b63..debb2551d0e 100644 --- a/tensorflow/__init__.py +++ b/tensorflow/__init__.py @@ -23,10 +23,6 @@ from __future__ import print_function # pylint: disable=g-bad-import-order from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import -from tensorflow.python.util.lazy_loader import LazyLoader -contrib = LazyLoader('contrib', globals(), 'tensorflow.contrib') -del LazyLoader - from tensorflow.python.platform import flags # pylint: disable=g-import-not-at-top from tensorflow.python.platform import app # pylint: disable=g-import-not-at-top app.flags = flags diff --git a/tensorflow/python/util/module_wrapper.py b/tensorflow/python/util/module_wrapper.py index 21cc4ff2d6a..dffdd513b4b 100644 --- a/tensorflow/python/util/module_wrapper.py +++ b/tensorflow/python/util/module_wrapper.py @@ -173,6 +173,8 @@ class TFModuleWrapper(types.ModuleType): attr_map[name] = attr return attr + # Placeholder for Google-internal contrib error + attr = super(TFModuleWrapper, self).__getattribute__(name) # Return and cache dunders and our own members. @@ -191,6 +193,8 @@ class TFModuleWrapper(types.ModuleType): try: attr = getattr(self._tfmw_wrapped_module, name) except AttributeError: + # Placeholder for Google-internal contrib error + if not self._tfmw_public_apis: raise if name not in self._tfmw_public_apis: