
    BVh                     4    d Z ddlmZ ddlmZ d ZddZd Zy)	zContains keras-specific LossScale functionality.

This functions cannot be in the non-keras loss_scale.py file since they depend
on keras, and files outside of keras should not depend on files inside keras.
    )generic_utils
loss_scalec                 ,    t        j                  |       S N)r   serialize_keras_objectr   s    b/home/dcms/DCMS/lib/python3.12/site-packages/tensorflow/python/keras/mixed_precision/loss_scale.py	serializer
      s    		-	-j	99    Nc                 v    t         j                  t         j                  d}t        j                  | ||d      S )N)FixedLossScaleDynamicLossScalez
loss scale)module_objectscustom_objectsprintable_module_name)loss_scale_moduler   r   r   deserialize_keras_object)configr   loss_scale_module_objectss      r	   deserializer      s=    )88+<<
 
	/	/.#(	
 r   c                    t        | t              rt        |       S t        | t        t        f      rt        j                  |       S | dk(  rt        j                         S t        | t
        j                        r| S | yt        d| z        )zGet a loss scale object.dynamicNz-Could not interpret loss scale identifier: %s)

isinstancedictr   intfloatr   r   r   	LossScale
ValueError)
identifiers    r	   getr    +   s    
D!z""
S%L)++J779--//
-778
D  ! !r   r   )	__doc__tensorflow.python.keras.utilsr   'tensorflow.python.training.experimentalr   r   r
   r   r     r   r	   <module>r%      s!    8 S:!r   