
    1Vh                         d Z 	 ddZy)zCGraph post-processing logic.

Used by both TensorBoard and mldash.
c                    | |t        d      |dk  rt        d|z        || j                  D ]  }t        |j                  j	                               }|D ]x  }|j                  |   j                         }||kD  s|dk  s+|j                  |= |j                  |   j                  j                  j                  |j                  d             z  yy)a  Prepares (modifies in-place) the graph to be served to the front-end.

    For now, it supports filtering out attributes that are
    too large to be shown in the graph UI.

    Args:
      graph: The GraphDef proto message.
      limit_attr_size: Maximum allowed size in bytes, before the attribute
          is considered large. Default is 1024 (1KB). Must be > 0 or None.
          If None, there will be no filtering.
      large_attrs_key: The attribute key that will be used for storing attributes
          that are too large. Default is '_too_large_attrs'. Must be != None if
          `limit_attr_size` is != None.

    Raises:
      ValueError: If `large_attrs_key is None` while `limit_attr_size != None`.
      ValueError: If `limit_attr_size` is defined, but <= 0.
    Nz<large_attrs_key must be != None when limit_attr_size!= None.    z&limit_attr_size must be > 0, but is %dzutf-8)	
ValueErrornodelistattrkeysByteSizesappendencode)graphlimit_attr_sizelarge_attrs_keyr   r   keysizes          Q/home/dcms/DCMS/lib/python3.12/site-packages/tensorboard/backend/process_graph.pyprepare_graph_for_uir      s    4 "" 
 a8?J 
 "JJ 	D 		()D 	yy~..0/)TAX		# IIo.3355<<

7+			 #    N)i   _too_large_attrs)__doc__r    r   r   <module>r      s    2D5r   