ó
    !Eñiþ  ã                   ó\   • S SK Jr  S SK7  S SKJrJr  \(       a  S SKJr  Sr " S S5      rg)	é    )ÚTYPE_CHECKING)Ú*)Ú_WaitCounterÚ_WaitCounterTracker)ÚSummaryWriterztorch.monitor.Statc                   ó4   • \ rS rSrSrS	S jrS\SS4S jrSrg)
ÚTensorboardEventHandleré   a-  
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                 ó   • Xl         g)z-
Constructs the ``TensorboardEventHandler``.
N©Ú_writer)ÚselfÚwriters     ÚS/home/mande/repo/quber/.venv/lib/python3.13/site-packages/torch/monitor/__init__.pyÚ__init__Ú TensorboardEventHandler.__init__   s	   € ð �ó    Úeventc                 óØ   • UR                   [        :X  aV  UR                  R                  5        H7  u  p#U R                  R                  X#UR                  R                  5       S9  M9     g g )N)Úwalltime)ÚnameÚ
STAT_EVENTÚdataÚitemsr   Ú
add_scalarÚ	timestamp)r   r   ÚkÚvs       r   Ú__call__Ú TensorboardEventHandler.__call__$   sP   € Ø�:‰:œÓ#ØŸ
™
×(Ñ(Ö*‘�Ø—‘×'Ñ'¨°u·±×7PÑ7PÓ7RÐ'ÓSò +ð $r   r   )r   r   r   N)	Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   ÚEventr    Ú__static_attributes__© 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   