parameters: (tensor, src=None, group=None, tag=0)
docstring: Receives a tensor synchronously.
  
      Args:
          tensor (Tensor): Tensor to fill with received data.
          src (int, optional): Source rank. Will receive from any
              process if unspecified.
          group (ProcessGroup, optional): The process group to work on. If None,
              the default process group will be used.
          tag (int, optional): Tag to match recv with remote send
  
      Returns:
          Sender rank
          -1, if not part of the group
docstring_summary: Receives a tensor synchronously.
docstring_tokens: Receives a tensor synchronously .
function: def recv(tensor, src=None, group=None, tag=0):
      """
      Receives a tensor synchronously.
  
      Args:
          tensor (Tensor): Tensor to fill with received data.
          src (int, optional): Source rank. Will receive from any
              process if unspecified.
          group (ProcessGroup, optional): The process group to work on. If None,
              the default process group will be used.
          tag (int, optional): Tag to match recv with remote send
  
      Returns:
          Sender rank
          -1, if not part of the group
  
      """
      _check_single_tensor(tensor, "tensor")
      if _rank_not_in_group(group):
          _warn_not_in_group("recv")
          return -1
  
      if group is None:
          pg = _get_default_group()
      else:
          pg = group
  
      if src is None:
          work = pg.recv_anysource([tensor], tag)
          work.wait()
          src_rank = work._source_rank()
          if group is None or group is GroupMember.WORLD:
              return src_rank
          else:
              return _get_global_rank(pg, src_rank)
      else:
          if group is None or group is GroupMember.WORLD:
              pg.recv([tensor], src, tag).wait()
          else:
              group_src_rank = _get_group_rank(pg, src)
              pg.recv([tensor], group_src_rank, tag).wait()
          return src
function_tokens: def recv ( tensor , src = None , group = None , tag = 0 ) : _check_single_tensor ( tensor , "tensor" ) if _rank_not_in_group ( group ) : _warn_not_in_group ( "recv" ) return - 1 if group is None : pg = _get_default_group ( ) else : pg = group if src is None : work = pg . recv_anysource ( [ tensor ] , tag ) work . wait ( ) src_rank = work . _source_rank ( ) if group is None or group is GroupMember . WORLD : return src_rank else : return _get_global_rank ( pg , src_rank ) else : if group is None or group is GroupMember . WORLD : pg . recv ( [ tensor ] , src , tag ) . wait ( ) else : group_src_rank = _get_group_rank ( pg , src ) pg . recv ( [ tensor ] , group_src_rank , tag ) . wait ( ) return src