o
    i                     @   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   c/sda-disk/www/egybert/egybert_env/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   )typing_extensionsr   r   r   r   r   r   r   r   <module>   s   