Ë
    [^(hþ  ã                   óR   — d dl mZ d dl­ d dlmZmZ erd dlmZ dZ G d„ d«      Zy)	é    )ÚTYPE_CHECKING)Ú*)Ú_WaitCounterÚ_WaitCounterTracker)ÚSummaryWriterztorch.monitor.Statc                   ó(   — e Zd ZdZdd„Zdeddfd„Zy)ÚTensorboardEventHandlera]  
    TensorboardEventHandler is an event handler that will write known events to
    the provided SummaryWriter.

    This currently only supports ``torch.monitor.Stat`` events which are logged
    as scalars.

    Example:
        >>> # xdoctest: +REQUIRES(env:TORCH_DOCTEST_MONITOR)
        >>> # xdoctest: +REQUIRES(module:tensorboard)
        >>> from torch.utils.tensorboard import SummaryWriter
        >>> from torch.monitor import TensorboardEventHandler, register_event_handler
        >>> writer = SummaryWriter("log_dir")
        >>> register_event_handler(TensorboardEventHandler(writer))
    ÚreturnNc                 ó   — || _         y)z=
        Constructs the ``TensorboardEventHandler``.
        N)Ú_writer)ÚselfÚwriters     úT/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/torch/monitor/__init__.pyÚ__init__z TensorboardEventHandler.__init__   s   € ð ˆ�ó    Úeventc                 óÜ   — |j                   t        k(  rY|j                  j                  «       D ];  \  }}| j                  j                  |||j                  j                  «       ¬«       Œ= y y )N)Úwalltime)ÚnameÚ
STAT_EVENTÚdataÚitemsr   Ú
add_scalarÚ	timestamp)r   r   ÚkÚvs       r   Ú__call__z TensorboardEventHandler.__call__$   s[   € Ø�:‰:œÒ#ØŸ
™
×(Ñ(Ó*ò T‘��1Ø—‘×'Ñ'¨¨1°u·±×7PÑ7PÓ7RÐ'ÕSñTð $r   )r   r   r
   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   ÚEventr   © r   r   r	   r	      s"   „ ñó ðT˜eð T¨ô Tr   r	   N)	Útypingr   Útorch._C._monitorr   r   Útorch.utils.tensorboardr   r   r	   r#   r   r   ú<module>r'      s'   ðÝ  ä ß ?ñ Ý5à!€
÷Tò Tr   