code: def segment_sum(data, segment_ids, name=None):
      """
      Segment Sum Operator.
  
      This operator sums the elements of input `data` which with
      the same index in `segment_ids`.
      It computes a tensor such that $out_i = \\sum_{j} data_{j}$
      where sum is over j such that `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.
      Returns:
         output (Tensor): the reduced result.
  
      Examples:
  
          .. code-block:: python
  
              import paddle
              import pgl
              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 = pgl.math.segment_sum(data, segment_ids)
              #Outputs: [[4., 4., 4.], [4., 5., 6.]]
  
      """
  
      return paddle.geometric.segment_sum(data, segment_ids, name)
  
file_path: PGL/pgl/math.py
imports: import paddle
  from pgl.utils.op import get_index_from_counts
label_desc: Use image node_id 2 for calling a global function with example usage: segment_sum(data, segment_ids, name) and returns: paddle