mindspore_gl.graph.BatchMeta
- class mindspore_gl.graph.BatchMeta(graph_nodes, graph_edges)[source]
BatchMeta, meta information for a batched graph.
- Parameters
graph_nodes (numpy.array) – array of accumulated node sum for graphs in batched graph (first element is 0).
graph_edges (numpy.array) – array of accumulated edge sum for graphs in batched graph (first element is 0).
- Supported Platforms:
Ascend
GPU
Examples
>>> from mindspore_gl.graph import BatchMeta >>> graph_nodes = np.array([0, 20, 40, 60, 80]) >>> graph_edges = np.array([0, 100, 200, 300, 400]) >>> graph = BatchMeta(graph_nodes, graph_edges) >>> print(graph[1]) (20, 100)
- property edge_map_idx
Index of edge list.
- Returns
numpy.array, array indicate graph index for each edge
- property graph_count
Graph numbers.
- Returns
int, total graph count in this batched graph
- property graph_edges
Edges array of graph.
- Returns
numpy.array, accumulated edge sum for graphs in batched graph(first element is 0)
- property graph_nodes
Nodes array of graph.
- Returns
numpy.array, accumulated node sum for graphs in batched graph(first element is 0)
- property node_map_idx
Index of node list.
- Returns
numpy.array, array indicate graph index for each node