o
    ٷiP                     @   sV   d dl Z d dlmZ de jdedejddfddZ		ddedejde jfd	d
ZdS )    Ntensordstgroupreturnc                 C   s0   |   } tj| jg||d tj| ||d d S )N)r   r   )
contiguousdistsend_object_listshapesend)r   r   r    r   m/home/ubuntu/.local/lib/python3.10/site-packages/cache_dit/parallelism/autoencoders/data_parallelism/utils.pysend_tensor   s   r   srcc                 C   s>   d g}t j|| |d tj|d ||d}t j|| |d |S )N)r   r   r   )devicedtype)r   recv_object_listtorchemptyrecv)r   r   r   r   objectstr   r   r   recv_tensor   s
   r   )NN)	r   torch.distributeddistributedr   TensorintProcessGroupr   r   r   r   r   r   <module>   s(    
