megengine.functional.distributed.remote_send

remote_send(inp, dest_rank)[源代码]

Send tensor to another process.

参数
  • inp (Tensor) – Tensor to send.

  • dest_rank (int) – Rank of destination process.

返回

None.

实际案例

if rank == 0:
    data = mge.tensor(1)
    # Tensor(1)
    F.distributed.remote_send(data, 1) # return None
else:
    data = F.distributed.remote_recv(0)
    # Tensor(1)