Ë
    BÆVh8  ã                   ó‚   — d Z ddlZddlZddlZddlmZ ddlmZ ddlmZ ddl	m
Z
 ddlmZ  eddd	g¬
«      dd„«       Zy)z-Utility functions for reading/writing graphs.é    N)Útext_format)Úbyte_swap_tensor)Úops)Úfile_io)Ú	tf_exportzio.write_graphztrain.write_graph)Úv1c                 ó2  — t        | t        j                  «      r| j                  «       }n| }t        j
                  dk(  r;t        |d«      rt        j                  |dd«       nt        j                  |dd«       |j                  d«      st        j                  |«       t        j                  j                  ||«      }|r-t        j                   |t#        j$                  |d¬«      «       |S t        j                   ||j'                  d¬«      «       |S )	a  Writes a graph proto to a file.

  The graph is written as a text proto unless `as_text` is `False`.

  ```python
  v = tf.Variable(0, name='my_variable')
  sess = tf.compat.v1.Session()
  tf.io.write_graph(sess.graph_def, '/tmp/my-model', 'train.pbtxt')
  ```

  or

  ```python
  v = tf.Variable(0, name='my_variable')
  sess = tf.compat.v1.Session()
  tf.io.write_graph(sess.graph, '/tmp/my-model', 'train.pbtxt')
  ```

  Args:
    graph_or_graph_def: A `Graph` or a `GraphDef` protocol buffer.
    logdir: Directory where to write the graph. This can refer to remote
      filesystems, such as Google Cloud Storage (GCS).
    name: Filename for the graph.
    as_text: If `True`, writes the graph as an ASCII proto.

  Returns:
    The path of the output proto file.
  ÚbigÚnodeÚlittlezgs:Ú )Úfloat_formatT)Údeterministic)Ú
isinstancer   ÚGraphÚas_graph_defÚsysÚ	byteorderÚhasattrr   Ú!swap_tensor_content_in_graph_nodeÚ%swap_tensor_content_in_graph_functionÚ
startswithr   Úrecursive_create_dirÚosÚpathÚjoinÚatomic_write_string_to_filer   ÚMessageToStringÚSerializeToString)Úgraph_or_graph_defÚlogdirÚnameÚas_textÚ	graph_defr   s         úT/home/dcms/DCMS/lib/python3.12/site-packages/tensorflow/python/framework/graph_io.pyÚwrite_graphr&      sñ   € ô< Ð"¤C§I¡IÔ.Ø"×/Ñ/Ó1Ià"€Iä‡]]eÒÜˆy˜&Ô!Ü×8Ñ8Ø
U˜Hõô ×<Ñ<Ø
U˜Hôð
 
×	Ñ	˜5Ô	!Ü× Ñ  Ô(Ü	‰‰f˜dÓ	#€$ÙÜ×'Ñ'¨Ü(3×(CÑ(CØ,5ÀBô)HôIð 
€+ô ×'Ñ'Øˆi×)Ñ)¸Ð)Ó=ô?à	€+ó    )T)Ú__doc__r   Úos.pathr   Úgoogle.protobufr   Útensorflow.python.frameworkr   r   Útensorflow.python.lib.ior   Ú tensorflow.python.util.tf_exportr   r&   © r'   r%   ú<module>r/      sF   ðñ  4Û 	Û Û 
å 'Ý 8Ý +Ý ,Ý 6ñ ÐÐ!1Ð3FÐ GÔHò7ó Iñ7r'   