
    sh.                         S SK Jr  S SKrS SKJr  SrS\R                  S\\   S\\   S\R                  4S	 jrS\R                  S
\S\R                  4S jr	g)    )SequenceN)ShardMetadataz@Please use DTensor instead and we are deprecating ShardedTensor.tensoroffsetssizesreturnc                     U n[        [        X5      5       H0  u  nu  pVX`R                  U5      :  d  M  UR                  XEU5      nM2     U$ )z;
Narrow the tensor according to ``offsets`` and ``sizes``.
)	enumeratezipsizenarrow)r   r   r   narrowed_tensoridxoffsetr   s          s/Users/tiagomarins/Projetos/claudeai/copy_bank/venv/lib/python3.13/site-packages/torch/distributed/_shard/_utils.pynarrow_tensor_by_indexr   
   sO     O(W)<=^f++c"" .44S$GO  >     metadatac                 B    [        XR                  UR                  5      $ )z-
Narrow the tensor according to the metadata
)r   shard_offsetsshard_sizes)r   r   s     r   narrow_tensorr      s     "&*@*@(BVBVWWr   )
collections.abcr   torch!torch.distributed._shard.metadatar   DEPRECATE_MSGTensorintr   r    r   r   <module>r       su    $  ; SLLc] C= \\	$X%,, X- XELL Xr   