class_docstr: Class that tracks and validates all serialization attributes.
  
  Keras models contain many Python-defined components. For example, the
  trainable_variable property lists the model's trainable variables by
  recursively retrieving the trainable variables from each of the child layers.
  Another example is model.call, a python function that calls child layers and
  adds ops to the backend graph.
  
  Only Tensorflow checkpointable objects and functions can be serialized to
  SavedModel. Serializing a Keras model as-is results in a checkpointable object
  that does not resemble a Keras model at all. Thus, extra checkpointable
  objects and functions must be created during serialization.
  
  **Defining new serialized attributes**
  Child classes should be defined using:
    SerializedAttributes.with_attributes(
        'name', checkpointable_objects=[...], functions=[...], copy_from=[...])
  This class is used to cache generated checkpointable objects and functions,
  ensuring that new objects and functions are generated a single time.
  
  **Usage during serialization**
  Each Layer/Model object should have a corresponding instance of
  SerializedAttributes. Create a new instance by calling
  `SerializedAttributes.new(obj)`. Objects and functions may be saved using
  `.set_and_validate_checkpointable_objects`/`.set_and_and_validate_functions`.
  The properties `.checkpointable_objects` and `.functions` returns the cached
  values.
  
  **Adding/changing attributes to save to SavedModel**
  1. Change the call to `SerializedAttributes.with_attributes` in the correct
     class:
     - CommonEndpoints: Base attributes to be added during serialization. If
       these attributes are present in a Trackable object, it can be
       deserialized to a Keras Model.
     - LayerAttributes: Attributes to serialize for Layer objects.
     - ModelAttributes: Attributes to serialize for Model objects.
  2. Update class docstring
  3. Update arguments to any calls to `set_and_validate_*`. For example, if
     `call_raw_tensors` is added to the ModelAttributes function list, then
     a `call_raw_tensors` function should be passed to
     `set_and_validate_functions`.
  
  **Common endpoints vs other attributes**
  Only common endpoints are attached directly to the root object. Keras-specific
  attributes are saved to a separate trackable object with the name "keras_api".
  The number of objects attached to the root is limited because any naming
  conflicts will cause user code to break.
  
  Another reason is that this will only affect users who call
  `tf.saved_model.load` instead of `tf.keras.models.load_model`. These are
  advanced users who are likely to have defined their own tf.functions and
  trackable objects. The added Keras-specific attributes are kept out of the way
  in the "keras_api" namespace.
  
  Properties defined in this class may be used to filter out keras-specific
  attributes:
  - `functions_to_serialize`: Returns dict of functions to attach to the root
      object.
  - `checkpointable_objects_to_serialize`: Returns dict of objects to attach to
      the root object (including separate trackable object containing
      keras-specific attributes)
  
  All changes to the serialized attributes must be backwards-compatible, so
  attributes should not be removed or modified without sufficient justification.
class_docstr_tok: ["Class","that","tracks","and","validates","all","serialization","attributes",".","Keras","models","contain","many","Python-defined","components",".","For","example",",","the","trainable_variable","property","lists","the","model","'s","trainable","variables","by","recursively","retrieving","the","trainable","variables","from","each","of","the","child","layers",".","Another","example","is","model.call",",","a","python","function","that","calls","child","layers","and","adds","ops","to","the","backend","graph",".","Only","Tensorflow","checkpointable","objects","and","functions","can","be","serialized","to","SavedModel",".","Serializing","a","Keras","model","as-is","results","in","a","checkpointable","object","that","does","not","resemble","a","Keras","model","at","all",".","Thus",",","extra","checkpointable","objects","and","functions","must","be","created","during","serialization",".","*","*","Defining","new","serialized","attributes","*","*","Child","classes","should","be","defined","using",":","SerializedAttributes.with_attributes","(","'name","'",",","checkpointable_objects=","[","...","]",",","functions=","[","...","]",",","copy_from=","[","...","]",")","This","class","is","used","to","cache","generated","checkpointable","objects","and","functions",",","ensuring","that","new","objects","and","functions","are","generated","a","single","time",".","*","*","Usage","during","serialization","*","*","Each","Layer\/Model","object","should","have","a","corresponding","instance","of","SerializedAttributes",".","Create","a","new","instance","by","calling","`","SerializedAttributes.new","(","obj",")","`",".","Objects","and","functions","may","be","saved","using","`",".set_and_validate_checkpointable_objects","`","\/","`",".set_and_and_validate_functions","`",".","The","properties","`",".checkpointable_objects","`","and","`",".functions","`","returns","the","cached","values",".","*","*","Adding\/changing","attributes","to","save","to","SavedModel","*","*","1",".","Change","the","call","to","`","SerializedAttributes.with_attributes","`","in","the","correct","class",":","-","CommonEndpoints",":","Base","attributes","to","be","added","during","serialization",".","If","these","attributes","are","present","in","a","Trackable","object",",","it","can","be","deserialized","to","a","Keras","Model",".","-","LayerAttributes",":","Attributes","to","serialize","for","Layer","objects",".","-","ModelAttributes",":","Attributes","to","serialize","for","Model","objects",".","2",".","Update","class","docstring","3",".","Update","arguments","to","any","calls","to","`","set_and_validate_","*","`",".","For","example",",","if","`","call_raw_tensors","`","is","added","to","the","ModelAttributes","function","list",",","then","a","`","call_raw_tensors","`","function","should","be","passed","to","`","set_and_validate_functions","`",".","*","*","Common","endpoints","vs","other","attributes","*","*","Only","common","endpoints","are","attached","directly","to","the","root","object",".","Keras-specific","attributes","are","saved","to","a","separate","trackable","object","with","the","name","``","keras_api","''",".","The","number","of","objects","attached","to","the","root","is","limited","because","any","naming","conflicts","will","cause","user","code","to","break",".","Another","reason","is","that","this","will","only","affect","users","who","call","`","tf.saved_model.load","`","instead","of","`","tf.keras.models.load_model","`",".","These","are","advanced","users","who","are","likely","to","have","defined","their","own","tf.functions","and","trackable","objects",".","The","added","Keras-specific","attributes","are","kept","out","of","the","way","in","the","``","keras_api","''","namespace",".","Properties","defined","in","this","class","may","be","used","to","filter","out","keras-specific","attributes",":","-","`","functions_to_serialize","`",":","Returns","dict","of","functions","to","attach","to","the","root","object",".","-","`","checkpointable_objects_to_serialize","`",":","Returns","dict","of","objects","to","attach","to","the","root","object","(","including","separate","trackable","object","containing","keras-specific","attributes",")","All","changes","to","the","serialized","attributes","must","be","backwards-compatible",",","so","attributes","should","not","be","removed","or","modified","without","sufficient","justification","."]
code: def __init__(self):
      self._object_dict = {}
      self._function_dict = {}
      self._keras_trackable = AutoTrackable()
  
imports: from tensorflow.python.eager import def_function
  from tensorflow.python.keras.saving.saved_model import constants
  from tensorflow.python.keras.saving.saved_model import save_impl
  from tensorflow.python.keras.utils.generic_utils import LazyLoader
  from tensorflow.python.trackable import base
  from tensorflow.python.trackable.autotrackable import AutoTrackable
label_desc: Use image node_id 3 to create a new SerializedAttributes object from inherited base classes: object with example: obj = SerializedAttributes()