
    &Vf                         d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlZ G d dej	                  Z
 G d	 d
e
          ZdS )zEGeneralized output options for writing tensor-formatted summary data.    )	event_pb2)summary_pb2)event_file_writer)tensor_utilNc                   z    e Zd ZdZej        dddd            Zej        d             Zej        d             ZdS )Outputag  Interface for emitting tensor-formatted summary data.

    Implementations of this interface can be passed to Writer to customize
    how summary data is actually persisted (e.g. to disk, to memory, over
    the network, etc.).

    TODO(#4581): This API should be considered EXPERIMENTAL and subject to
    backwards-incompatible changes without notice.
    Ntag_metadatadescriptionc                    dS )a  Emits one scalar data point to this Output.

        Args:
          plugin_name: string name to uniquely identify the type of time series
            (historically associated with a TensorBoard plugin).
          tag: string tag used to uniquely identify this time series.
          data: `np.float32` scalar value for this data point.
          step: `np.int64` scalar step value for this data point.
          wall_time: `float` seconds since the Unix epoch, representing the
            real-world timestamp for this data point.
          tag_metadata: optional bytes containing metadata for this entire time
            series. This should be constant for a given tag; only the first
            value encountered will be used.
          description: optional string description for this entire time series.
            This should be constant for a given tag; only the first value
            encountered will be used.
        N )selfplugin_nametagdatastep	wall_timer
   r   s           X/var/www/html/software/conda/lib/python3.11/site-packages/tensorboard/summary/_output.pyemit_scalarzOutput.emit_scalar$   s	    : 	    c                     dS )z(Flushes any data that has been buffered.Nr   r   s    r   flushzOutput.flushC   	     	r   c                     dS )z5Closes the Output and also flushes any buffered data.Nr   r   s    r   closezOutput.closeH   r   r   )	__name__
__module____qualname____doc__abcabstractmethodr   r   r   r   r   r   r   r      s          	     < 	   	    r   r   c                   2    e Zd ZdZd ZddddZd Zd ZdS )DirectoryOutputzOutputs summary data by writing event files to a log directory.

    TODO(#4581): This API should be considered EXPERIMENTAL and subject to
    backwards-incompatible changes without notice.
    c                 8    t          j        |          | _        dS )z/Creates a `DirectoryOutput` for the given path.N)r   EventFileWriter
_ev_writer)r   paths     r   __init__zDirectoryOutput.__init__U   s    +;DAAr   Nr	   c                \   t          j        t           j                            ||          |t           j        j                  }t          j        |          }	t          j        ||          }
|
j	        j
                            ||	|           | j                            |
           dS )See `Output`.)r   content)plugin_datasummary_description
data_class)r   r   )r   tensormetadataN)r   SummaryMetadata
PluginData	DataClassDATA_CLASS_SCALARr   make_tensor_protor   Eventsummaryvalueaddr'   	add_event)r   r   r   r   r   r   r
   r   summary_metadatatensor_protoevents              r   r   zDirectoryOutput.emit_scalarY   s     '6#3>>' ?   !,",>
 
 
 #4T::)$???L3C 	  	
 	
 	
 	!!%(((((r   c                 8    | j                                          dS r+   N)r'   r   r   s    r   r   zDirectoryOutput.flusht   s    r   c                 8    | j                                          dS r@   )r'   r   r   s    r   r   zDirectoryOutput.closex   s     	r   )r   r   r   r    r)   r   r   r   r   r   r   r$   r$   N   so         B B B ) ) ) ) )6              r   r$   )r    tensorboard.compat.protor   r   tensorboard.summary.writerr   tensorboard.utilr   r!   ABCr   r$   r   r   r   <module>rF      s    L K . . . . . . 0 0 0 0 0 0 8 8 8 8 8 8 ( ( ( ( ( ( 



2 2 2 2 2SW 2 2 2j.  .  .  .  . f .  .  .  .  . r   