mindspore_gl.graph.BatchHomoGraph
- class mindspore_gl.graph.BatchHomoGraph[source]
BatchHomoGraph, batch list of MindHomoGraph into a single MindHomoGraph with some batch_meta information.
- Inputs:
graph_list (List[MindHomoGraph]) - A list of MindHomoGraph.
- Supported Platforms:
Ascend
GPU
Examples
>>> from mindspore_gl.graph.ops import BatchHomoGraph >>> import numpy as np >>> from mindspore_gl.graph import MindHomoGraph >>> graph_list = [] >>> for _ in range(5): ... graph = MindHomoGraph() ... edges = np.array([[0, 2, 2, 3, 4, 5, 5, 6], [1, 0, 1, 5, 3, 4, 6, 4]]) ... graph.set_topo_coo(edges) ... graph.node_count = 7 ... graph.edge_count = 8 ... graph_list.append(graph) >>> batch_fn = BatchHomoGraph() >>> batch_graph = batch_fn(graph_list) >>> print(batch_graph.edge_count) 40