o
    z“©iK  ã                   @   sj   d dl mZ d dlmZ d dlmZ G dd„ deƒZG dd„ deƒZG dd	„ d	eƒZeG d
d„ dƒƒZ	dS )é    )Ú	dataclass)ÚOptional)ÚLightningEnumc                   @   s2   e Zd ZdZdZdZdZdZede	fdd„ƒZ
d	S )
ÚTrainerStatuszNEnum for the status of the :class:`~pytorch_lightning.trainer.trainer.Trainer`ÚinitializingÚrunningÚfinishedÚinterruptedÚreturnc                 C   s   | | j | jfv S ©N)ÚFINISHEDÚINTERRUPTED©Úself© r   úT/home/ubuntu/.local/lib/python3.10/site-packages/pytorch_lightning/trainer/states.pyÚstopped   s   zTrainerStatus.stoppedN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚINITIALIZINGÚRUNNINGr   r   ÚpropertyÚboolr   r   r   r   r   r      s    r   c                   @   s    e Zd ZdZdZdZdZdZdS )Ú	TrainerFnzáEnum for the user-facing functions of the :class:`~pytorch_lightning.trainer.trainer.Trainer` such as
    :meth:`~pytorch_lightning.trainer.trainer.Trainer.fit` and
    :meth:`~pytorch_lightning.trainer.trainer.Trainer.test`.ÚfitÚvalidateÚtestÚpredictN)r   r   r   r   ÚFITTINGÚ
VALIDATINGÚTESTINGÚ
PREDICTINGr   r   r   r   r   !   s    r   c                   @   sL   e Zd ZdZdZdZdZdZdZe	de
fdd	„ƒZe	dee fd
d„ƒZdS )ÚRunningStagea  Enum for the current running stage.

    This stage complements :class:`TrainerFn` by specifying the current running stage for each function.
    More than one running stage value can be set while a :class:`TrainerFn` is running:

        - ``TrainerFn.FITTING`` - ``RunningStage.{SANITY_CHECKING,TRAINING,VALIDATING}``
        - ``TrainerFn.VALIDATING`` - ``RunningStage.VALIDATING``
        - ``TrainerFn.TESTING`` - ``RunningStage.TESTING``
        - ``TrainerFn.PREDICTING`` - ``RunningStage.PREDICTING``

    ÚtrainÚsanity_checkr   r   r   r
   c                 C   s   | | j | j| jfv S r   )r!   r"   ÚSANITY_CHECKINGr   r   r   r   Ú
evaluating?   s   zRunningStage.evaluatingc                 C   s   | | j | jfv r
dS | jS )NÚval)r!   r'   Úvaluer   r   r   r   Údataloader_prefixC   s   zRunningStage.dataloader_prefixN)r   r   r   r   ÚTRAININGr'   r!   r"   r#   r   r   r(   r   Ústrr+   r   r   r   r   r$   ,   s    r$   c                   @   sd   e Zd ZU dZejZeed< dZe	e
 ed< dZe	e ed< edefdd„ƒZedefd	d
„ƒZdS )ÚTrainerStatez_Dataclass to encapsulate the current :class:`~pytorch_lightning.trainer.trainer.Trainer` state.ÚstatusNÚfnÚstager
   c                 C   s   | j tjkS r   )r/   r   r   r   r   r   r   r   R   s   zTrainerState.finishedc                 C   s   | j jS r   )r/   r   r   r   r   r   r   V   s   zTrainerState.stopped)r   r   r   r   r   r   r/   Ú__annotations__r0   r   r   r1   r$   r   r   r   r   r   r   r   r   r.   J   s   
 r.   N)
Údataclassesr   Útypingr   Ú!pytorch_lightning.utilities.enumsr   r   r   r$   r.   r   r   r   r   Ú<module>   s   