From 12ee3420367f9a0f728c6b2e0493f5fb150eea47 Mon Sep 17 00:00:00 2001 From: Anna R Date: Sun, 21 Apr 2019 22:09:47 -0700 Subject: [PATCH] Automated rollback of commit 93b440f7935ec889a0e60f10107fc7b9495ee5b0 PiperOrigin-RevId: 244614266 --- tensorflow/api_template.__init__.py | 9 ++++++--- tensorflow/api_template_v1.__init__.py | 6 ++++-- tensorflow/compat_template.__init__.py | 9 ++++++--- tensorflow/compat_template_v1.__init__.py | 6 ++++-- 4 files changed, 20 insertions(+), 10 deletions(-) diff --git a/tensorflow/api_template.__init__.py b/tensorflow/api_template.__init__.py index aaa7a1a2c7d..feaf805f684 100644 --- a/tensorflow/api_template.__init__.py +++ b/tensorflow/api_template.__init__.py @@ -55,20 +55,23 @@ elif _tf_api_dir not in __path__: # Hook external TensorFlow modules. try: from tensorboard.summary._tf import summary - _current_module.__path__.append(_module_util.get_parent_dir(summary)) + _current_module.__path__ = ( + [_module_util.get_parent_dir(summary)] + _current_module.__path__) except ImportError: _logging.warning( "Limited tf.summary API due to missing TensorBoard installation.") try: from tensorflow_estimator.python.estimator.api._v2 import estimator - _current_module.__path__.append(_module_util.get_parent_dir(estimator)) + _current_module.__path__ = ( + [_module_util.get_parent_dir(estimator)] + _current_module.__path__) except ImportError: pass try: from tensorflow.python.keras.api._v2 import keras - _current_module.__path__.append(_module_util.get_parent_dir(keras)) + _current_module.__path__ = ( + [_module_util.get_parent_dir(keras)] + _current_module.__path__) except ImportError: pass diff --git a/tensorflow/api_template_v1.__init__.py b/tensorflow/api_template_v1.__init__.py index f27c2bc7a52..8a14abc3c2c 100644 --- a/tensorflow/api_template_v1.__init__.py +++ b/tensorflow/api_template_v1.__init__.py @@ -44,13 +44,15 @@ elif _tf_api_dir not in __path__: # Hook external TensorFlow modules. try: from tensorflow_estimator.python.estimator.api._v1 import estimator - _current_module.__path__.append(_module_util.get_parent_dir(estimator)) + _current_module.__path__ = ( + [_module_util.get_parent_dir(estimator)] + _current_module.__path__) except ImportError: pass try: from tensorflow.python.keras.api._v1 import keras - _current_module.__path__.append(_module_util.get_parent_dir(keras)) + _current_module.__path__ = ( + [_module_util.get_parent_dir(keras)] + _current_module.__path__) except ImportError: pass diff --git a/tensorflow/compat_template.__init__.py b/tensorflow/compat_template.__init__.py index f50dfbd239f..ad2443a0c32 100644 --- a/tensorflow/compat_template.__init__.py +++ b/tensorflow/compat_template.__init__.py @@ -32,7 +32,8 @@ from tensorflow.python.tools import module_util as _module_util _current_module = _sys.modules[__name__] try: from tensorboard.summary._tf import summary - _current_module.__path__.append(_module_util.get_parent_dir(summary)) + _current_module.__path__ = ( + [_module_util.get_parent_dir(summary)] + _current_module.__path__) except ImportError: _logging.warning( "Limited tf.compat.v2.summary API due to missing TensorBoard " @@ -40,13 +41,15 @@ except ImportError: try: from tensorflow_estimator.python.estimator.api._v2 import estimator - _current_module.__path__.append(_module_util.get_parent_dir(estimator)) + _current_module.__path__ = ( + [_module_util.get_parent_dir(estimator)] + _current_module.__path__) except ImportError: pass try: from tensorflow.python.keras.api._v2 import keras - _current_module.__path__.append(_module_util.get_parent_dir(keras)) + _current_module.__path__ = ( + [_module_util.get_parent_dir(keras)] + _current_module.__path__) except ImportError: pass diff --git a/tensorflow/compat_template_v1.__init__.py b/tensorflow/compat_template_v1.__init__.py index 0a553150148..23c722edef7 100644 --- a/tensorflow/compat_template_v1.__init__.py +++ b/tensorflow/compat_template_v1.__init__.py @@ -31,13 +31,15 @@ from tensorflow.python.tools import module_util as _module_util _current_module = _sys.modules[__name__] try: from tensorflow_estimator.python.estimator.api._v1 import estimator - _current_module.__path__.append(_module_util.get_parent_dir(estimator)) + _current_module.__path__ = ( + [_module_util.get_parent_dir(estimator)] + _current_module.__path__) except ImportError: pass try: from tensorflow.python.keras.api._v1 import keras - _current_module.__path__.append(_module_util.get_parent_dir(keras)) + _current_module.__path__ = ( + [_module_util.get_parent_dir(keras)] + _current_module.__path__) except ImportError: pass