o
    H&iW                     @   sP   d dl mZmZmZmZ d dlmZ ddgZeG dd deZededZ	dS )    )AnyDictruntime_checkableTypeVar)ProtocolStateful	StatefulTc                   @   s@   e Zd ZdZdeeef fddZdeeef ddfddZdS )	r   zN
    Stateful protocol for objects that can be checkpointed and restored.
    returnc                 C      dS )a  
        Objects should return their state_dict representation as a dictionary.
        The output of this function will be checkpointed, and later restored in
        `load_state_dict()`.

        .. warning::
            Because of the inplace nature of restoring a checkpoint, this function
            is also called during `torch.distributed.checkpoint.load`.


        Returns:
            Dict: The objects state dict
        N )selfr   r   PC:\wamp64\www\opt\env\Lib\site-packages\torch/distributed/checkpoint/stateful.py
state_dict   s   zStateful.state_dictr   Nc                 C   r
   )z
        Restore the object's state from the provided state_dict.

        Args:
            state_dict: The state dict to restore from
        Nr   )r   r   r   r   r   load_state_dict    s   zStateful.load_state_dict)	__name__
__module____qualname____doc__r   strr   r   r   r   r   r   r   r   	   s    )boundN)
typingr   r   r   r   Ztyping_extensionsr   __all__r   r   r   r   r   r   <module>   s    !