§
    “©ºjï  ã                   ó@   — d dl mZ d dlZd dlmZ  G d„ d¦  «        ZdS )é    )ÚOptionalN)Ú_BaseProgressc                   óö   — e Zd ZdZdd„Zedefd„¦   «         Zej        deddfd	„¦   «         Zedefd
„¦   «         Z	dd„Z
defd„Zdeddfd„Zddee         dedefd„Z	 ddededdfd„Zdededdfd„Zdd„ZdS )Ú_LoopzBasic Loops interface.Útrainerú
pl.TrainerÚreturnNc                 ó>   — d| _         d| _        d| _        || _        d S ©NF)Ú_restartingÚ_loaded_from_state_dictÚ_resuming_from_checkpointr   )Úselfr   s     úl/root/private/project/pallet_detection_v2/.venv/lib/python3.11/site-packages/pytorch_lightning/loops/loop.pyÚ__init__z_Loop.__init__   s%   € Ø ˆÔØ',ˆÔ$Ø).ˆÔ&ØˆŒˆˆó    c                 ó   — | j         S )zDWhether the state of this loop was reloaded and it needs to restart.)r   ©r   s    r   Ú
restartingz_Loop.restarting   s   € ð ÔÐr   r   c                 ó”   — || _         t          | ¦  «                             ¦   «         D ]}t          |t          ¦  «        r||_        ŒdS )z7Connects this loop's restarting value and its children.N)r   ÚvarsÚvaluesÚ
isinstancer   r   )r   r   Úloops      r   r   z_Loop.restarting"   sQ   € ð &ˆÔÝ˜‘J”J×%Ò%Ñ'Ô'ð 	-ð 	-ˆDÝ˜$¥Ñ&Ô&ð -Ø",�”øð	-ð 	-r   c                 ó   — | j         S )z>Indicates whether training is being resumed from a checkpoint.)r   r   s    r   Úis_resumingz_Loop.is_resuming*   s   € ð Ô-Ð-r   c                 ó   — d S )N© r   s    r   Úreset_restart_stagez_Loop.reset_restart_stage/   s   € Øˆr   c                 ó   — i S )z�Called when saving a model checkpoint, use to persist loop state.

        Returns:
            The current loop state.

        r   r   s    r   Úon_save_checkpointz_Loop.on_save_checkpoint2   s	   € ð ˆ	r   Ú
state_dictc                 ó   — dS )zACalled when loading a model checkpoint, use to reload loop state.Nr   )r   r"   s     r   Úon_load_checkpointz_Loop.on_load_checkpoint;   s   € € € r   Ú ÚdestinationÚprefixc                 ó@  — |€i }|                       ¦   «         ||dz   <   | j                             ¦   «         D ]e\  }}||z   }t          |t          ¦  «        r|                     ¦   «         ||<   Œ7t          |t          ¦  «        r|                     ||dz   ¦  «         Œf|S )a?  The state dict is determined by the state and progress of this loop and all its children.

        Args:
            destination: An existing dictionary to update with this loop's state. By default a new dictionary
                is returned.
            prefix: A prefix for each key in the state dictionary

        Nr"   ú.)r!   Ú__dict__Úitemsr   r   r"   r   )r   r&   r'   ÚkÚvÚkeys         r   r"   z_Loop.state_dict>   s¬   € ð ÐØˆKà-1×-DÒ-DÑ-FÔ-Fˆ�F˜\Ñ)Ñ*à”M×'Ò'Ñ)Ô)ð 	5ð 	5‰DˆAˆqØ˜1‘*ˆCÝ˜!�]Ñ+Ô+ð 5Ø#$§<¢<¡>¤>�˜CÑ Ð Ý˜A�uÑ%Ô%ð 5Ø—’˜[¨#°©)Ñ4Ô4Ð4øØÐr   c                 óD  — |                       |                     ¦   «         |¦  «         | j                             ¦   «         D ]H\  }}t	          |t
          ¦  «        r.|                     |                     ¦   «         ||z   dz   ¦  «         ŒId| _        d| _        d| _	        dS )z2Loads the state of this loop and all its children.r)   TN)
Ú_load_from_state_dictÚcopyr*   r+   r   r   Úload_state_dictr   r   r   )r   r"   r'   r,   r-   s        r   r2   z_Loop.load_state_dictT   s¡   € ð 	×"Ò" :§?¢?Ñ#4Ô#4°fÑ=Ô=Ð=Ø”M×'Ò'Ñ)Ô)ð 	Gð 	G‰DˆAˆqÝ˜!�UÑ#Ô#ð GØ×!Ò! *§/¢/Ñ"3Ô"3°V¸a±ZÀ#Ñ5EÑFÔFÐFøØˆŒØ'+ˆÔ$Ø)-ˆÔ&Ð&Ð&r   c                 ó  — | j                              ¦   «         D ]?\  }}||z   }||vrŒt          |t          ¦  «        r|                     ||         ¦  «         Œ@|dz   |v r |                      ||dz            ¦  «         d S d S )Nr"   )r*   r+   r   r   r2   r$   )r   r"   r'   r,   r-   r.   s         r   r0   z_Loop._load_from_state_dictb   s¡   € Ø”M×'Ò'Ñ)Ô)ð 	3ð 	3‰DˆAˆqØ˜1‘*ˆCØ˜*Ð$Ð$àÝ˜!�]Ñ+Ô+ð 3Ø×!Ò! *¨S¤/Ñ2Ô2Ð2øØ�LÑ  JÐ.Ð.Ø×#Ò# J¨v¸Ñ/DÔ$EÑFÔFÐFÐFÐFð /Ð.r   c                 óX   — d| _         d| _        d| _        |                      ¦   «          d S r   )r   r   r   r   r   s    r   Úon_iteration_donez_Loop.on_iteration_donem   s2   € Ø ˆÔØ',ˆÔ$Ø).ˆÔ&Ø× Ò Ñ"Ô"Ð"Ð"Ð"r   )r   r   r	   N)r	   N)Nr%   )r%   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   ÚpropertyÚboolr   Úsetterr   r   Údictr!   r$   r   Ústrr"   r2   r0   r5   r   r   r   r   r      s¶  € € € € € Ø Ð ðð ð ð ð ð ˜Dð  ð  ð  ñ „Xð ð Ôð- Tð -¨dð -ð -ð -ñ Ôð-ð ð.˜Tð .ð .ð .ñ „Xð.ðð ð ð ð Dð ð ð ð ðP¨Tð P°dð Pð Pð Pð Pðð  h¨t¤nð ÀSð ÐRVð ð ð ð ð2 ð.ð .àð.ð ð.ð 
ð	.ð .ð .ð .ð	G°ð 	G¸cð 	GÀdð 	Gð 	Gð 	Gð 	Gð#ð #ð #ð #ð #ð #r   r   )Útypingr   Úpytorch_lightningÚplÚ pytorch_lightning.loops.progressr   r   r   r   r   ú<module>rC      ss   ðð Ð Ð Ð Ð Ð à Ð Ð Ð Ø :Ð :Ð :Ð :Ð :Ð :ð]#ð ]#ð ]#ð ]#ð ]#ñ ]#ô ]#ð ]#ð ]#ð ]#r   