From 6f968a3a59b2d11ac74e0c0d9921dc3d660e765c Mon Sep 17 00:00:00 2001 From: Scott Zhu Date: Mon, 9 Mar 2020 16:22:10 -0700 Subject: [PATCH] Remove all the save model related code in base_layer. They are not applicable for the v1 tf.layers case. PiperOrigin-RevId: 299962368 Change-Id: I7c6f4fb76ff3e5aa83d4fc0db817ed4e1b73a827 --- tensorflow/python/frozen_keras/engine/BUILD | 1 - .../frozen_keras/engine/legacy_base_layer.py | 21 ------------------- 2 files changed, 22 deletions(-) diff --git a/tensorflow/python/frozen_keras/engine/BUILD b/tensorflow/python/frozen_keras/engine/BUILD index bfdb06aeb75..337e27079de 100644 --- a/tensorflow/python/frozen_keras/engine/BUILD +++ b/tensorflow/python/frozen_keras/engine/BUILD @@ -42,7 +42,6 @@ py_library( "//tensorflow/python/frozen_keras/utils:layer_utils", "//tensorflow/python/frozen_keras/utils:tf_utils", "//tensorflow/python/keras:metrics", - "//tensorflow/python/keras/saving", "//tensorflow/python/module", "//tensorflow/python/ops/ragged:ragged_tensor", "//tensorflow/python/training/tracking", diff --git a/tensorflow/python/frozen_keras/engine/legacy_base_layer.py b/tensorflow/python/frozen_keras/engine/legacy_base_layer.py index be82901b64a..df2838aab8e 100644 --- a/tensorflow/python/frozen_keras/engine/legacy_base_layer.py +++ b/tensorflow/python/frozen_keras/engine/legacy_base_layer.py @@ -61,7 +61,6 @@ from tensorflow.python.frozen_keras.engine import node as node_module from tensorflow.python.frozen_keras.utils import generic_utils from tensorflow.python.frozen_keras.utils import layer_utils from tensorflow.python.frozen_keras.utils import tf_utils -from tensorflow.python.keras.saving.saved_model import layer_serialization # A module that only depends on `keras.layers` import these from here. from tensorflow.python.keras.utils.generic_utils import to_snake_case # pylint: disable=unused-import from tensorflow.python.keras.utils.tf_utils import is_tensor_or_tensor_list # pylint: disable=unused-import @@ -2575,26 +2574,6 @@ class LegacyBaseLayer(module.Module): # SavedModel properties. Please see keras/saving/saved_model for details. - @property - def _trackable_saved_model_saver(self): - return layer_serialization.LayerSavedModelSaver(self) - - @property - def _object_identifier(self): - return self._trackable_saved_model_saver.object_identifier - - @property - def _tracking_metadata(self): - return self._trackable_saved_model_saver.tracking_metadata - - def _list_extra_dependencies_for_serialization(self, serialization_cache): - return (self._trackable_saved_model_saver - .list_extra_dependencies_for_serialization(serialization_cache)) - - def _list_functions_for_serialization(self, serialization_cache): - return (self._trackable_saved_model_saver - .list_functions_for_serialization(serialization_cache)) - def __getstate__(self): # Override to support `copy.deepcopy` and pickling. # Thread-local objects cannot be copied in Python 3, so pop these.