1# Copyright 2021 The TensorFlow Authors. All Rights Reserved. 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14# ============================================================================== 15"""A mixin class that delegates another Trackable to be used when saving. 16 17This is intended to be used with wrapper classes that cannot directly proxy the 18wrapped object (e.g. with wrapt.ObjectProxy), because there are inner attributes 19that cannot be exposed. 20 21The Wrapper class itself cannot contain any Trackable children, as only the 22delegated Trackable will be saved to checkpoint and SavedModel. 23 24This class will "disappear" and be replaced with the wrapped inner Trackable 25after a cycle of SavedModel saving and loading, unless the object is registered 26and loaded with Keras. 27""" 28 29 30# TODO(kathywu): Delete this file after all imports have been moved to the path 31# below. 32from tensorflow.python.trackable import base_delegate 33from tensorflow.python.util import deprecation 34 35__getattr__ = deprecation.deprecate_moved_module( 36 __name__, base_delegate, "2.11") 37