
    קg                     N    d dl mZmZmZ d dlZe G d de                      ZdS )    )AnyProtocolruntime_checkableNc                   >    e Zd ZdZdedefdZd Zdej	        f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objectc                      t          d          )zI
        Return a list of WriteItems based on object's contents.
        z6_Checkpointable._create_write_items is not implementedNotImplementedError)selfr   r	   s      ]/var/www/html/ai-engine/env/lib/python3.11/site-packages/torch/distributed/_checkpointable.py__create_write_items__z&_Checkpointable.__create_write_items__   s     "D
 
 	
    c                      t          d          )zU
        Return a list of `ChunkStorageMetadata` based on object's contents.
        z5_Checkpointable._create_chunk_list is not implementedr   )r   s    r   __create_chunk_list__z%_Checkpointable.__create_chunk_list__   s     "C
 
 	
r   returnc                      t          d          )zI
        Return a 'torch.Tensor' shard based on 'MetadataIndex'.
        z4_Checkpointable._get_tensor_shard is not implementedr   )r   indexs     r   __get_tensor_shard__z$_Checkpointable.__get_tensor_shard__    s     "B
 
 	
r   N)__name__
__module____qualname____doc__strr   r   r   torchTensorr    r   r   r   r      sl         
# 
s 
 
 
 

 
 

U\ 
 
 
 
 
 
r   r   )typingr   r   r   r   r   r   r   r   <module>r       so    4 3 3 3 3 3 3 3 3 3  
 
 
 
 
h 
 
 
 
 
r   