
    6bi-
                     B    S r SSKrSSKrSSKJs  Jr  SSKJr  S r	S r
g)z5Saving utilities to support Python's Pickle protocol.    N)
saving_libc                    [         R                  " 5       n [        R                  R	                  US5      n[        US5       nUR                  U 5        SSS5        [        R                  " USS9nU[        R                  R                  R                  U5        $ ! , (       d  f       NN= f! [         a  nUeSnAff = f! [        R                  R                  R                  U5        f = f)zReconstruct a Model from the output of `serialize_model_as_bytecode`.

Args:
    serialized_model: (bytes) return value from
      `serialize_model_as_bytecode`.

Returns:
    TF-Keras Model instance.
model.keraswbNF)	safe_mode)tempfilemkdtempospathjoinopenwriter   
load_modeltfiogfilermtree	Exception)serialized_modeltemp_dirfilepathfmodeles         Z/home/james-whalen/.local/lib/python3.13/site-packages/tf_keras/src/saving/pickle_utils.pydeserialize_model_from_bytecoder      s     !H%77<<-8(D!QGG$% " %%h%@ 
8$ "!  
 	8$sA   ,B. BB. 2C 
B+'B. .
B?8B::B??C +C-c                    [         R                  " 5       n [        R                  R	                  US5      n[
        R                  " X5        [        US5       nUR                  5       nSSS5        W[        R                  R                  R                  U5        $ ! , (       d  f       N9= f! [         a  nUeSnAff = f! [        R                  R                  R                  U5        f = f)zConvert a TF-Keras Model into a bytecode representation for pickling.

Args:
    model: TF-Keras Model instance.

Returns:
    Tuple that can be read by `deserialize_from_bytecode`.
r   rbN)r   r	   r
   r   r   r   
save_modelr   readr   r   r   r   r   )r   r   r   r   datar   s         r   serialize_model_as_bytecoder"   7   s     !H
%77<<-8e.(D!Q668D "
 
8$ "! 
 	8$sB   AB. B*B. 2C 
B+'B. .
B?8B::B??C +C-)__doc__r
   r   tensorflow.compat.v2compatv2r   tf_keras.src.savingr   r   r"        r   <module>r*      s#    < 	  ! ! *%>%r)   