code: def test_disjoint_tensor_graph(self):
      glist = []
      dim = 4
      for i in range(5):
          src_num_nodes = np.random.randint(low=2, high=10)
          dst_num_nodes = np.random.randint(low=2, high=10)
          edges_size = np.random.randint(low=1, high=10)
          edges_src = np.random.randint(
              low=1, high=src_num_nodes, size=[edges_size, 1]
          )
  
          edges_dst = np.random.randint(
              low=1, high=dst_num_nodes, size=[edges_size, 1]
          )
  
          edges = np.hstack([edges_src, edges_dst])
  
          src_nfeat = np.random.randn(src_num_nodes, dim)
          dst_nfeat = np.random.randn(dst_num_nodes, dim)
          efeat = np.random.randn(len(edges), dim)
  
          g = pgl.BiGraph(
              edges=paddle.to_tensor(edges),
              src_num_nodes=paddle.to_tensor(src_num_nodes),
              dst_num_nodes=paddle.to_tensor(dst_num_nodes),
              src_node_feat={"nfeat": paddle.to_tensor(src_nfeat)},
              dst_node_feat={"nfeat": paddle.to_tensor(dst_nfeat)},
              edge_feat={"efeat": paddle.to_tensor(efeat)},
          )
          glist.append(g)
      # Merge Graph
      multi_graph = pgl.BiGraph.disjoint(glist)
      # Check Graph Index
      src_node_index = [
          np.ones(g.src_num_nodes) * n for n, g in enumerate(glist)
      ]
      dst_node_index = [
          np.ones(g.dst_num_nodes) * n for n, g in enumerate(glist)
      ]
      edge_index = [
          np.ones(g.num_edges) * n for n, g in enumerate(glist)
      ]
      src_node_index = np.concatenate(src_node_index)
      dst_node_index = np.concatenate(dst_node_index)
      edge_index = np.concatenate(edge_index)
      self.assertTrue(
          np.all(
              src_node_index == multi_graph.graph_src_node_id.numpy()
          )
      )
      self.assertTrue(
          np.all(
              dst_node_index == multi_graph.graph_dst_node_id.numpy()
          )
      )
      self.assertTrue(
          np.all(edge_index == multi_graph.graph_edge_id.numpy())
      )
  
      multi_graph.tensor()
      self.assertTrue(
          np.all(
              src_node_index == multi_graph.graph_src_node_id.numpy()
          )
      )
      self.assertTrue(
          np.all(
              dst_node_index == multi_graph.graph_dst_node_id.numpy()
          )
      )
      self.assertTrue(
          np.all(edge_index == multi_graph.graph_edge_id.numpy())
      )
  
      multi_graph = pgl.BiGraph.disjoint([glist[0]])
      self.assertEqual(
          multi_graph.src_node_feat["nfeat"].shape,
          [int(glist[0].src_num_nodes), dim],
      )
      self.assertEqual(
          multi_graph.dst_node_feat["nfeat"].shape,
          [int(glist[0].dst_num_nodes), dim],
      )
  
imports: import os
  import unittest
  import numpy
  import paddle
  import pgl
  from testsuite import create_random_bigraph
label_desc: Use image node_id 7 for calling the BiGraphTest obj's underlying member method code with example usage: obj.test_disjoint_tensor_graph() without return types