o
    2hF                     @   s2   d Z ddlmZ ddlmZ d	ddZdd ZdS )
zFContains summaries related to laying out the custom scalars dashboard.    )
layout_pb2)metadataNc                 C   sP   ddl m  m} t| tjsJ t }|jj	tj
|j|  |jd||dS )a  Creates a summary that contains a layout.

    When users navigate to the custom scalars dashboard, they will see a layout
    based on the proto provided to this function.

    Args:
      scalars_layout: The scalars_layout_pb2.Layout proto that specifies the
          layout.
      collections: Optional list of graph collections keys. The new
          summary op is added to these collections. Defaults to
          `[Graph Keys.SUMMARIES]`.

    Returns:
      A tensor summary op that writes the layout to disk.
    r   Ndtype)nametensorcollectionssummary_metadata)tensorflow.compat.v1compatv1
isinstancer   Layoutr   create_summary_metadatasummarytensor_summaryCONFIG_SUMMARY_TAGconstantSerializeToStringstring)scalars_layoutr   tfr	    r   d/var/www/html/chatgem/venv/lib/python3.10/site-packages/tensorboard/plugins/custom_scalar/summary.pyop   s   r   c                 C   sj   ddl m  m} t| tjsJ |j|  |jd}|j	
t  }| }|jjtj||d |S )aV  Creates a summary that contains a layout.

    When users navigate to the custom scalars dashboard, they will see a layout
    based on the proto provided to this function.

    Args:
      scalars_layout: The scalars_layout_pb2.Layout proto that specifies the
          layout.

    Returns:
      A summary proto containing the layout.
    r   Nr   )tagr   r   )r
   r   r   r   r   r   make_tensor_protor   r   SummaryMetadata
FromStringr   r   Summaryvalueaddr   )r   r   r   tf_summary_metadatar   r   r   r   pb3   s   

r#   )N)__doc__!tensorboard.plugins.custom_scalarr   r   r   r#   r   r   r   r   <module>   s
   
