code: def test_send_and_recv(self):
      np.random.seed(0)
      src_num_nodes = 5
      dst_num_nodes = 4
      edges = [(0, 1), (1, 2), (3, 3), (4, 1), (1, 0)]
      src_nfeat = np.array(
          [
              [1, 2, 3, 4],
              [2, 3, 4, 5],
              [3, 4, 5, 6],
              [4, 5, 6, 7],
              [5, 6, 7, 8],
          ],
          dtype="float32",
      )
  
      dst_nfeat = np.array(
          [[2, 3, 4, 5], [3, 4, 5, 6], [4, 5, 6, 7], [5, 6, 7, 8]],
          dtype="float32",
      )
  
      src_ground = np.array(
          [
              [1, 2, 3, 4],
              [2, 3, 4, 5],
              [4, 5, 6, 7],
              [5, 6, 7, 8],
              [2, 3, 4, 5],
          ],
          dtype="float32",
      )
  
      src_recv = np.array(
          [[2, 3, 4, 5], [6, 8, 10, 12], [2, 3, 4, 5], [4, 5, 6, 7]]
      )
  
      dst_ground = np.array(
          [
              [3, 4, 5, 6],
              [4, 5, 6, 7],
              [5, 6, 7, 8],
              [3, 4, 5, 6],
              [2, 3, 4, 5],
          ],
          dtype="float32",
      )
  
      dst_recv = np.array(
          [
              [3, 4, 5, 6],
              [6, 8, 10, 12],
              [0, 0, 0, 0],
              [5, 6, 7, 8],
              [3, 4, 5, 6],
          ]
      )
  
      g = pgl.BiGraph(
          edges=edges,
          src_num_nodes=src_num_nodes,
          dst_num_nodes=dst_num_nodes,
          src_node_feat={"src_nfeat": src_nfeat},
          dst_node_feat={"dst_nfeat": dst_nfeat},
      )
  
      g.tensor()
  
      def send_func1(src_feat, dst_feat, edge_feat):
          return src_feat
  
      def send_func2(src_feat, dst_feat, edge_feat):
          return {"h": src_feat["h"]}
  
      def reduce_func(msg):
          return msg.reduce_sum(msg["h"])
  
      # test send_func1
      msg1 = g.send(
          send_func1, src_feat={"h": g.src_node_feat["src_nfeat"]}
      )
      _msg = msg1["h"].numpy()
      self.assertTrue((src_ground == _msg).all())
  
      output = g.recv(reduce_func, msg1)
      output = output.numpy()
      self.assertTrue((src_recv == output).all())
  
      # test send_func2
      msg2 = g.send(
          send_func2, src_feat={"h": g.src_node_feat["src_nfeat"]}
      )
      _msg = msg2["h"].numpy()
      self.assertTrue((src_ground == _msg).all())
  
      output = g.recv(reduce_func, msg2)
      output = output.numpy()
      self.assertTrue((src_recv == output).all())
  
      def send_func1_d(src_feat, dst_feat, edge_feat):
          return dst_feat
  
      def send_func2_d(src_feat, dst_feat, edge_feat):
          return {"h": dst_feat["h"]}
  
      def reduce_func_d(msg):
          return msg.reduce_sum(msg["h"])
  
      # test send_func1
      msg1 = g.send(
          send_func1_d, dst_feat={"h": g.dst_node_feat["dst_nfeat"]}
      )
      _msg = msg1["h"].numpy()
      self.assertTrue((dst_ground == _msg).all())
  
      output = g.recv(reduce_func_d, msg1, recv_mode="src")
      output = output.numpy()
      self.assertTrue((dst_recv == output).all())
  
      # test send_func2
      msg2 = g.send(
          send_func2_d, dst_feat={"h": g.dst_node_feat["dst_nfeat"]}
      )
      _msg = msg2["h"].numpy()
      self.assertTrue((dst_ground == _msg).all())
  
      output = g.recv(reduce_func_d, msg2, recv_mode="src")
      output = output.numpy()
      self.assertTrue((dst_recv == output).all())
  
imports: import os
  import unittest
  import numpy
  import paddle
  import pgl
  from testsuite import create_random_bigraph
label_desc: Use image node_id 12 for calling the BiGraphTest obj's underlying member method code with example usage: obj.test_send_and_recv() and returns: src_feat, dict, msg, dst_feat, dict, msg