| 323 | |
| 324 | @staticmethod |
| 325 | def construct_graphs(node_data, edge_data, graph_data=None): |
| 326 | if not isinstance(node_data, list): |
| 327 | node_data = [node_data] |
| 328 | if not isinstance(edge_data, list): |
| 329 | edge_data = [edge_data] |
| 330 | node_dict = NodeData.to_dict(node_data) |
| 331 | edge_dict = EdgeData.to_dict(edge_data, node_dict) |
| 332 | graph_dict = DGLGraphConstructor._construct_graphs(node_dict, edge_dict) |
| 333 | if graph_data is None: |
| 334 | graph_data = GraphData(np.full(1, 0), {}) |
| 335 | graphs, data = GraphData.to_dict(graph_data, graph_dict) |
| 336 | return graphs, data |
| 337 | |
| 338 | @staticmethod |
| 339 | def _construct_graphs(node_dict, edge_dict): |