class_docstr: A deprecated dtype policy for a Keras layer.
  
  Warning: This class is now deprecated and will be removed soon. Please use the
  non-experimental class `tf.keras.mixed_precision.Policy` instead.
  
  The difference between this class and the non-experimental class is that this
  class has a `loss_scale` field and the non-experimental class does not. The
  loss scale is only used by `tf.keras.Model.compile`, which automatically wraps
  the optimizer with a `LossScaleOptimizer` if the optimizer is not already a
  `LossScaleOptimizer`. For the non-experimental Policy class, `Model.compile`
  instead wraps the optimizer with a `LossScaleOptimizer` if `Policy.name` is
  "mixed_float16".
  
  When deserializing objects with an experimental policy using functions like
  `tf.keras.utils.deserialize_keras_object`, the policy will be deserialized as
  the non-experimental `tf.keras.mixed_precision.Policy`, and the loss scale
  will silently be dropped. This is so that SavedModels that are generated
  with an experimental policy can be restored after the experimental policy is
  removed.
class_docstr_tok: ["A","deprecated","dtype","policy","for","a","Keras","layer",".","Warning",":","This","class","is","now","deprecated","and","will","be","removed","soon",".","Please","use","the","non-experimental","class","`","tf.keras.mixed_precision.Policy","`","instead",".","The","difference","between","this","class","and","the","non-experimental","class","is","that","this","class","has","a","`","loss_scale","`","field","and","the","non-experimental","class","does","not",".","The","loss","scale","is","only","used","by","`","tf.keras.Model.compile","`",",","which","automatically","wraps","the","optimizer","with","a","`","LossScaleOptimizer","`","if","the","optimizer","is","not","already","a","`","LossScaleOptimizer","`",".","For","the","non-experimental","Policy","class",",","`","Model.compile","`","instead","wraps","the","optimizer","with","a","`","LossScaleOptimizer","`","if","`","Policy.name","`","is","''","mixed_float16","''",".","When","deserializing","objects","with","an","experimental","policy","using","functions","like","`","tf.keras.utils.deserialize_keras_object","`",",","the","policy","will","be","deserialized","as","the","non-experimental","`","tf.keras.mixed_precision.Policy","`",",","and","the","loss","scale","will","silently","be","dropped",".","This","is","so","that","SavedModels","that","are","generated","with","an","experimental","policy","can","be","restored","after","the","experimental","policy","is","removed","."]
code: def from_config(cls, config, custom_objects=None):
      if "loss_scale" in config and isinstance(
          config["loss_scale"], dict
      ):
          config = config.copy()
          config["loss_scale"] = keras_loss_scale_module.deserialize(
              config["loss_scale"], custom_objects=custom_objects
          )
      return cls(**config)
  
imports: import contextlib
  from tensorflow.python.framework import dtypes
  from tensorflow.python.keras import backend
  from tensorflow.python.keras.engine import base_layer_utils
  from tensorflow.python.keras.mixed_precision import device_compatibility_check
  from tensorflow.python.keras.mixed_precision import loss_scale
  from tensorflow.python.keras.utils import generic_utils
  from tensorflow.python.platform import tf_logging
  from tensorflow.python.training.experimental import mixed_precision_global_state
label_desc: Use image node_id 5 for calling the PolicyV1 obj's underlying member method code with example usage: obj.from_config(cls, config, custom_objects) and returns: cls