code: def test_send_func(self):
      num_nodes = 4
      dim = 4
      edges = [(0, 1), (1, 2), (2, 3)]
      nfeat = np.arange(num_nodes).reshape(-1, 1)
      efeat = np.arange(len(edges)).reshape(-1, 1)
  
      target_src = np.array([0, 1, 2]).reshape(-1, 1)
      target_dst = np.array([1, 2, 3]).reshape(-1, 1)
      target_edge = np.array([0, 1, 2]).reshape(-1, 1)
  
      g1 = pgl.Graph(
          edges=edges,
          num_nodes=num_nodes,
          node_feat={"nfeat": nfeat},
          edge_feat={"efeat": efeat},
      )
  
      g1.tensor()
      src_copy = lambda sf, df, ef: {"h": sf["h"], "e": ef["e"]}
      dst_copy = lambda sf, df, ef: {"h": df["h"], "e": ef["e"]}
      both_copy = lambda sf, df, ef: {
          "sh": sf["h"],
          "dh": df["h"],
          "e": ef["e"],
      }
  
      msg = g1.send(
          src_copy,
          src_feat={"h": g1.node_feat["nfeat"]},
          edge_feat={"e": g1.edge_feat["efeat"]},
      )
      self.assertTrue((msg["h"].numpy() == target_src).all())
      self.assertTrue((msg["e"].numpy() == target_edge).all())
  
      msg = g1.send(
          dst_copy,
          dst_feat={"h": g1.node_feat["nfeat"]},
          edge_feat={"e": g1.edge_feat["efeat"]},
      )
      self.assertTrue((msg["h"].numpy() == target_dst).all())
      self.assertTrue((msg["e"].numpy() == target_edge).all())
  
      msg = g1.send(
          both_copy,
          node_feat={"h": g1.node_feat["nfeat"]},
          edge_feat={"e": g1.edge_feat["efeat"]},
      )
      self.assertTrue((msg["sh"].numpy() == target_src).all())
      self.assertTrue((msg["dh"].numpy() == target_dst).all())
      self.assertTrue((msg["e"].numpy() == target_edge).all())
  
imports: import os
  import unittest
  import numpy
  import paddle
  import pgl
  from testsuite import create_random_graph
label_desc: Use image node_id 11 for calling the GraphTest obj's underlying member method code with example usage: obj.test_send_func() without return types