class_docstr: This implement Message for graph.recv.
  
  Args:
  
      msg: A dictionary provided by send function.
  
      segment_ids: The id that the message belongs to.
class_docstr_tok: ["This","implement","Message","for","graph.recv",".","Args",":","msg",":","A","dictionary","provided","by","send","function",".","segment_ids",":","The","id","that","the","message","belongs","to","."]
docstr: This is the inverse method for reduce.
  
  Args:
  
      feature (paddle.Tensor): A reduced message. 
  
  Returns:
  
      Returns a paddle.Tensor with the first dim the same as the num_edges.
  
  Examples:
  
      .. code-block:: python
  
          import numpy as np
          import pgl
          import paddle
  
          num_nodes = 5
          edges = [ (0, 1), (1, 2), (3, 4)]
          feature = np.random.randn(5, 100)
          edge_feature = np.random.randn(3, 100)
          graph = pgl.Graph(num_nodes=num_nodes,
                  edges=edges,
                  node_feat={
                      "feature": feature
                  },
                  edge_feat={
                      "edge_feature": edge_feature
                  })
          graph.tensor() 
  
          def send_func(src_feat, dst_feat, edge_feat):
              return { "out": src_feat["feature"] }
  
          message = graph.send(send_func, src_feat={"feature": graph.node_feat["feature"]})
  
          def recv_func(msg):
              value = msg["out"]
              max_value = msg.reduce_max(value)
              # We want to subscribe the max_value correspond to the destination node.
              max_value = msg.edge_expand(max_value)
              value = value - max_value
              return msg.reduce_sum(value)
             
          out = graph.recv(recv_func, message)
docstr_tok: ["This","is","the","inverse","method","for","reduce",".","Args",":","feature","(","paddle.Tensor",")",":","A","reduced","message",".","Returns",":","Returns","a","paddle.Tensor","with","the","first","dim","the","same","as","the","num_edges",".","Examples",":","..","code-block",":",":","python","import","numpy","as","np","import","pgl","import","paddle","num_nodes","=","5","edges","=","[","(","0",",","1",")",",","(","1",",","2",")",",","(","3",",","4",")","]","feature","=","np.random.randn","(","5",",","100",")","edge_feature","=","np.random.randn","(","3",",","100",")","graph","=","pgl.Graph","(","num_nodes=num_nodes",",","edges=edges",",","node_feat=","{","``","feature","''",":","feature","}",",","edge_feat=","{","``","edge_feature","''",":","edge_feature","}",")","graph.tensor","(",")","def","send_func","(","src_feat",",","dst_feat",",","edge_feat",")",":","return","{","``","out","''",":","src_feat","[","``","feature","''","]","}","message","=","graph.send","(","send_func",",","src_feat=","{","``","feature","''",":","graph.node_feat","[","``","feature","''","]","}",")","def","recv_func","(","msg",")",":","value","=","msg","[","``","out","''","]","max_value","=","msg.reduce_max","(","value",")","#","We","want","to","subscribe","the","max_value","correspond","to","the","destination","node",".","max_value","=","msg.edge_expand","(","max_value",")","value","=","value","-","max_value","return","msg.reduce_sum","(","value",")","out","=","graph.recv","(","recv_func",",","message",")"]
code: def edge_expand(self, msg):
      """This is the inverse method for reduce.
  
      Args:
  
          feature (paddle.Tensor): A reduced message.
  
      Returns:
  
          Returns a paddle.Tensor with the first dim the same as the num_edges.
  
      Examples:
  
          .. code-block:: python
  
              import numpy as np
              import pgl
              import paddle
  
              num_nodes = 5
              edges = [ (0, 1), (1, 2), (3, 4)]
              feature = np.random.randn(5, 100)
              edge_feature = np.random.randn(3, 100)
              graph = pgl.Graph(num_nodes=num_nodes,
                      edges=edges,
                      node_feat={
                          "feature": feature
                      },
                      edge_feat={
                          "edge_feature": edge_feature
                      })
              graph.tensor()
  
              def send_func(src_feat, dst_feat, edge_feat):
                  return { "out": src_feat["feature"] }
  
              message = graph.send(send_func, src_feat={"feature": graph.node_feat["feature"]})
  
              def recv_func(msg):
                  value = msg["out"]
                  max_value = msg.reduce_max(value)
                  # We want to subscribe the max_value correspond to the destination node.
                  max_value = msg.edge_expand(max_value)
                  value = value - max_value
                  return msg.reduce_sum(value)
  
              out = graph.recv(recv_func, message)
  
      """
  
      return paddle.gather(msg, self._segment_ids, axis=0)
  
file_path: PGL/pgl/message.py
imports: import paddle
  import pgl.math
label_desc: Use image node_id 7 for calling the Message obj's underlying member method code with example usage: obj.edge_expand(msg) and returns: paddle