o
    ûÇh  ã                   @   s0   d dl mZmZ d dlZeG dd„ deƒƒZdS )é    )ÚProtocolÚruntime_checkableNc                   @   sP   e Zd ZdZdededee fdd„Zdee fdd„Zd	e	de
jfd
d„ZdS )Ú_Checkpointablea  
    Interface for checkpointable objects.
    Implemented as a protocol, implicit subtyping is supported so subclasses do not need to inherit this explicitly.
    This is to allow arbitrary objects/tensor subclasses to hook into DCP seamlessly through implementing the interface.
    ÚfqnÚobjectÚreturnc                 C   ó   t dƒ‚)zI
        Return a list of WriteItems based on object's contents.
        z6_Checkpointable._create_write_items is not implemented©ÚNotImplementedError)Úselfr   r   © r   úu/var/www/html/construction_image-detection-poc/venv/lib/python3.10/site-packages/torch/distributed/_checkpointable.pyÚ__create_write_items__   ó   ÿz&_Checkpointable.__create_write_items__c                 C   r   )zU
        Return a list of `ChunkStorageMetadata` based on object's contents.
        z5_Checkpointable._create_chunk_list is not implementedr	   )r   r   r   r   Ú__create_chunk_list__   r   z%_Checkpointable.__create_chunk_list__Úindexc                 C   r   )zI
        Return a 'torch.Tensor' shard based on 'MetadataIndex'.
        z4_Checkpointable._get_tensor_shard is not implementedr	   )r   r   r   r   r   Ú__get_tensor_shard__   r   z$_Checkpointable.__get_tensor_shard__N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ústrr   Úlistr   r   ÚintÚtorchÚTensorr   r   r   r   r   r      s
    r   )Útypingr   r   r   r   r   r   r   r   Ú<module>   s   