parameters: (data, segment_ids, name=None)
return_statement: return out
docstring: r"""
      Segment mean Operator.
  
      Ihis operator calculate the mean value of input `data` which
      with the same index in `segment_ids`.
      It computes a tensor such that $out_i = \\frac{1}{n_i}  \\sum_{j} data[j]$
      where sum is over j such that 'segment_ids[j] == i' and $n_i$ is the number
      of all index 'segment_ids[j] == i'.
  
      Args:
          data (tensor): a tensor, available data type float32, float64.
          segment_ids (tensor): a 1-d tensor, which have the same size 
                              with the first dimension of input data. 
                              available data type is int32, int64.
          name (str, optional): Name for the operation (optional, default is None). 
                              For more information, please refer to :ref:`api_guide_Name`.
  
      Returns:
         output (Tensor): the reduced result.
  
      Examples:
  
          .. code-block:: python
  
              import paddle
              data = paddle.to_tensor([[1, 2, 3], [3, 2, 1], [4, 5, 6]], dtype='float32')
              segment_ids = paddle.to_tensor([0, 0, 1], dtype='int32')
              out = paddle.incubate.segment_mean(data, segment_ids)
              #Outputs: [[2., 2., 2.], [4., 5., 6.]]
docstring_summary: r"""
      Segment mean Operator.
docstring_tokens: r Segment mean Operator .
function: def segment_mean(data, segment_ids, name=None):
      r"""
      Segment mean Operator.
  
      Ihis operator calculate the mean value of input `data` which
      with the same index in `segment_ids`.
      It computes a tensor such that $out_i = \\frac{1}{n_i}  \\sum_{j} data[j]$
      where sum is over j such that 'segment_ids[j] == i' and $n_i$ is the number
      of all index 'segment_ids[j] == i'.
  
      Args:
          data (tensor): a tensor, available data type float32, float64.
          segment_ids (tensor): a 1-d tensor, which have the same size 
                              with the first dimension of input data. 
                              available data type is int32, int64.
          name (str, optional): Name for the operation (optional, default is None). 
                              For more information, please refer to :ref:`api_guide_Name`.
  
      Returns:
         output (Tensor): the reduced result.
  
      Examples:
  
          .. code-block:: python
  
              import paddle
              data = paddle.to_tensor([[1, 2, 3], [3, 2, 1], [4, 5, 6]], dtype='float32')
              segment_ids = paddle.to_tensor([0, 0, 1], dtype='int32')
              out = paddle.incubate.segment_mean(data, segment_ids)
              #Outputs: [[2., 2., 2.], [4., 5., 6.]]
  
      """
      if in_dygraph_mode():
          out, tmp = _C_ops.segment_pool(data, segment_ids, 'pooltype', "MEAN")
          return out
  
      check_variable_and_dtype(data, "X", ("float32", "float64"), "segment_pool")
      check_variable_and_dtype(segment_ids, "SegmentIds", ("int32", "int64"),
                               "segment_pool")
  
      helper = LayerHelper("segment_mean", **locals())
      out = helper.create_variable_for_type_inference(dtype=data.dtype)
      summed_ids = helper.create_variable_for_type_inference(dtype=data.dtype)
      helper.append_op(
          type="segment_pool",
          inputs={"X": data,
                  "SegmentIds": segment_ids},
          outputs={"Out": out,
                   "SummedIds": summed_ids},
          attrs={"pooltype": "MEAN"})
      return out
function_tokens: def segment_mean ( data , segment_ids , name = None ) : if in_dygraph_mode ( ) : out , tmp = _C_ops . segment_pool ( data , segment_ids , 'pooltype' , "MEAN" ) return out check_variable_and_dtype ( data , "X" , ( "float32" , "float64" ) , "segment_pool" ) check_variable_and_dtype ( segment_ids , "SegmentIds" , ( "int32" , "int64" ) , "segment_pool" ) helper = LayerHelper ( "segment_mean" , * * locals ( ) ) out = helper . create_variable_for_type_inference ( dtype = data . dtype ) summed_ids = helper . create_variable_for_type_inference ( dtype = data . dtype ) helper . append_op ( type = "segment_pool" , inputs = { "X" : data , "SegmentIds" : segment_ids } , outputs = { "Out" : out , "SummedIds" : summed_ids } , attrs = { "pooltype" : "MEAN" } ) return out