code: def graph_send_recv(x, src_index, dst_index, pool_type="sum"):
      """This method combines the send and recv function in different pool_type.
  
      Now, this method only supports default copy send function, and built-in receive pool_type
      function ('sum', 'mean', 'max', 'min').
  
      Args:
  
          x (Tensor): The input tensor, and the available data type is float32, float64, int32, int64.
  
          src_index (Tensor): An 1-D tensor, and the available data type is int32, int64.
  
          dst_index (Tensor): An 1-D tensor, and should have the same shape as `src_index`.
                              The available data type is int32, int64.
  
          pool_type (str): The pooling type of graph_send_recv, including `sum`, `mean`,
                           `max`, `min`. Default value is `sum`.
  
      Returns:
  
          out (Tensor): The output tensor, should have the same shape and same dtype as input tensor `x`.
  
      """
  
      # TODO:@ZHUI add support for 'mean', 'max', 'min' pool_type.
      assert (
          pool_type == "sum"
      ), "Only implement 'sum' pool_type function right now. Maybe you can update PaddlePaddle version to fix this problem."
  
      def send(message_func, src_feat):
          src_feat_temp = {}
          if src_feat is not None:
              assert isinstance(
                  src_feat, dict
              ), "The input src_feat must be a dict"
              src_feat_temp.update(src_feat)
          src_feat = op.RowReader(src_feat_temp, src_index)
          msg = message_func(src_feat)
          return msg
  
      def _sum_recv(feat):
          output_dim = feat.shape[-1]
          init_output = paddle.zeros(
              shape=[x.shape[0], output_dim], dtype=feat.dtype
          )
          final_output = paddle.scatter(
              init_output, dst_index, feat, overwrite=False
          )
          return final_output
  
      msg = send(lambda sf: {"msg": sf["h"]}, src_feat={"h": x})
  
      return eval("_%s_recv" % pool_type)(msg["msg"])
  
file_path: PGL/pgl/utils/helper.py
imports: import numpy
  import paddle
  from paddle.common_ops_import import Variable
  from paddle.framework import core
  from pgl.utils import op
label_desc: Use image node_id 7 for calling a global function with example usage: graph_send_recv(x, src_index, dst_index, pool_type) and returns: eval, msg, final_output