parameters: (tensor, dst=0, group=None, use_calc_stream=True)
docstring: Send a tensor to the receiver.
  
      Args:
          tensor (Tensor): The Tensor to send. Its data type
              should be float16, float32, float64, int32 or int64.
          dst (int): The destination rank id.
          group (Group, optional): The group instance return by new_group or None for global default group. Default: None.
          use_calc_stream (bool, optional): Whether to use calculate stream or communication stream. Default: True.
      
      Returns:
          None.
  
      Examples:
          .. code-block:: python
  
              # required: distributed
              import paddle
              from paddle.distributed import init_parallel_env
  
              init_parallel_env()
              if paddle.distributed.ParallelEnv().rank == 0:
                  data = paddle.to_tensor([7, 8, 9])
                  paddle.distributed.send(data, dst=1)
              else:
                  data = paddle.to_tensor([1,2,3])
                  paddle.distributed.recv(data, src=0)
              out = data.numpy()
docstring_summary: Send a tensor to the receiver.
docstring_tokens: Send a tensor to the receiver .
function: def send(tensor, dst=0, group=None, use_calc_stream=True):
      """
      Send a tensor to the receiver.
  
      Args:
          tensor (Tensor): The Tensor to send. Its data type
              should be float16, float32, float64, int32 or int64.
          dst (int): The destination rank id.
          group (Group, optional): The group instance return by new_group or None for global default group. Default: None.
          use_calc_stream (bool, optional): Whether to use calculate stream or communication stream. Default: True.
      
      Returns:
          None.
  
      Examples:
          .. code-block:: python
  
              # required: distributed
              import paddle
              from paddle.distributed import init_parallel_env
  
              init_parallel_env()
              if paddle.distributed.ParallelEnv().rank == 0:
                  data = paddle.to_tensor([7, 8, 9])
                  paddle.distributed.send(data, dst=1)
              else:
                  data = paddle.to_tensor([1,2,3])
                  paddle.distributed.recv(data, src=0)
              out = data.numpy()
      """
      if group is not None and not group.is_member():
          return
      ring_id = 0 if group is None else group.id
  
      if in_dygraph_mode():
          return _C_ops.send_v2(tensor, 'use_calc_stream', use_calc_stream,
                                'ring_id', ring_id, 'peer', dst)
      op_type = 'send_v2'
      check_variable_and_dtype(
          tensor, 'tensor', ['float16', 'float32', 'float64', 'int32', 'int64'],
          'send')
  
      helper = LayerHelper(op_type, **locals())
      helper.append_op(
          type=op_type,
          inputs={'X': [tensor]},
          attrs={
              'ring_id': ring_id,
              'peer': dst,
              'use_calc_stream': use_calc_stream,
          })
function_tokens: def send ( tensor , dst = 0 , group = None , use_calc_stream = True ) : if group is not None and not group . is_member ( ) : return ring_id = 0 if group is None else group . id if in_dygraph_mode ( ) : return _C_ops . send_v2 ( tensor , 'use_calc_stream' , use_calc_stream , 'ring_id' , ring_id , 'peer' , dst ) op_type = 'send_v2' check_variable_and_dtype ( tensor , 'tensor' , [ 'float16' , 'float32' , 'float64' , 'int32' , 'int64' ] , 'send' ) helper = LayerHelper ( op_type , * * locals ( ) ) helper . append_op ( type = op_type , inputs = { 'X' : [ tensor ] } , attrs = { 'ring_id' : ring_id , 'peer' : dst , 'use_calc_stream' : use_calc_stream , } )