a
    d=icÝ  ã                   @   s   d Z ddd„ZdS )zCGraph post-processing logic.

Used by both TensorBoard and mldash.
é   Ú_too_large_attrsc                 C   sœ   |dur,|du rt dƒ‚|dkr,t d| ƒ‚|dur˜| jD ]\}t|j ¡ ƒ}|D ]D}|j|  ¡ }||ksr|dk rP|j|= |j| jj | d¡¡ qPq:dS )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ÚkeysZByteSizeÚsÚappendÚencode)ÚgraphZlimit_attr_sizeZlarge_attrs_keyr   r   ÚkeyÚsize© r   úr/home/droni/.local/share/virtualenvs/DPS-5Je3_V2c/lib/python3.9/site-packages/tensorboard/backend/process_graph.pyÚprepare_graph_for_ui   s&    ÿÿ
ÿr   N)r   r   )Ú__doc__r   r   r   r   r   Ú<module>   s    ÿ