class_docstr: This module implement base class for graph wrapper.
  
  Currently our PGL is developed based on static computational mode of
  paddle (we'll support dynamic computational model later). We need to build
  model upon a virtual data holder. BaseGraphWrapper provide a virtual
  graph structure that users can build deep learning models
  based on this virtual graph. And then feed real graph data to run
  the models. Moreover, we provide convenient message-passing interface
  (send & recv) for building graph neural networks.
  
  NOTICE: Don't use this BaseGraphWrapper directly. Use :code:`GraphWrapper`
  and :code:`StaticGraphWrapper` to create graph wrapper instead.
class_docstr_tok: ["This","module","implement","base","class","for","graph","wrapper",".","Currently","our","PGL","is","developed","based","on","static","computational","mode","of","paddle","(","we","'ll","support","dynamic","computational","model","later",")",".","We","need","to","build","model","upon","a","virtual","data","holder",".","BaseGraphWrapper","provide","a","virtual","graph","structure","that","users","can","build","deep","learning","models","based","on","this","virtual","graph",".","And","then","feed","real","graph","data","to","run","the","models",".","Moreover",",","we","provide","convenient","message-passing","interface","(","send","&","recv",")","for","building","graph","neural","networks",".","NOTICE",":","Do","n't","use","this","BaseGraphWrapper","directly",".","Use",":","code",":","`","GraphWrapper","`","and",":","code",":","`","StaticGraphWrapper","`","to","create","graph","wrapper","instead","."]
docstr: Recv message and aggregate the message by reduce_fucntion
  
  The UDF reduce_function function should has the following format.
  
  .. code-block:: python
  
      def reduce_func(msg):
          '''
              Args:
                  msg: A LodTensor or a dictionary of LodTensor whose batch_size
                       is equals to the number of unique dst nodes.
  
              Return:
                  It should return a tensor with shape (batch_size, out_dims). The
                  batch size should be the same as msg.
          '''
          pass
  
  Args:
      msg: A tensor or a dictionary of tensor created by send function..
  
      reduce_function: UDF reduce function or strings "sum" as built-in function.
                       The built-in "sum" will use scatter_add to optimized the speed.
  
  Return:
      A tensor with shape (num_nodes, out_dims). The output for nodes with no message
      will be zeros.
docstr_tok: ["Recv","message","and","aggregate","the","message","by","reduce_fucntion","The","UDF","reduce_function","function","should","has","the","following","format",".","..","code-block",":",":","python","def","reduce_func","(","msg",")",":","``","'","Args",":","msg",":","A","LodTensor","or","a","dictionary","of","LodTensor","whose","batch_size","is","equals","to","the","number","of","unique","dst","nodes",".","Return",":","It","should","return","a","tensor","with","shape","(","batch_size",",","out_dims",")",".","The","batch","size","should","be","the","same","as","msg.","``","'","pass","Args",":","msg",":","A","tensor","or","a","dictionary","of","tensor","created","by","send","function","..","reduce_function",":","UDF","reduce","function","or","strings","``","sum","''","as","built-in","function",".","The","built-in","``","sum","''","will","use","scatter_add","to","optimized","the","speed",".","Return",":","A","tensor","with","shape","(","num_nodes",",","out_dims",")",".","The","output","for","nodes","with","no","message","will","be","zeros","."]
code: def recv(self, msg, reduce_function):
      """Recv message and aggregate the message by reduce_fucntion
  
      The UDF reduce_function function should has the following format.
  
      .. code-block:: python
  
          def reduce_func(msg):
              '''
                  Args:
                      msg: A LodTensor or a dictionary of LodTensor whose batch_size
                           is equals to the number of unique dst nodes.
  
                  Return:
                      It should return a tensor with shape (batch_size, out_dims). The
                      batch size should be the same as msg.
              '''
              pass
  
      Args:
          msg: A tensor or a dictionary of tensor created by send function..
  
          reduce_function: UDF reduce function or strings "sum" as built-in function.
                           The built-in "sum" will use scatter_add to optimized the speed.
  
      Return:
          A tensor with shape (num_nodes, out_dims). The output for nodes with no message
          will be zeros.
      """
      output = recv(
          dst=self._edges_dst,
          uniq_dst=self._edge_uniq_dst,
          bucketing_index=self._edge_uniq_dst_count,
          msg=msg,
          reduce_function=reduce_function,
          num_edges=self._num_edges,
          num_nodes=self._num_nodes,
      )
      return output
  
imports: import warnings
  import numpy
  import paddle.fluid
  import paddle.fluid.layers
  from pgl.utils import op
  from pgl.utils import paddle_helper
  from pgl.utils.logger import log
label_desc: Use image node_id 4 for calling the BaseGraphWrapper obj's underlying member method code with example usage: obj.recv(msg, reduce_function) and returns: output