mlx_graphs.data.collate.collate#
- mlx_graphs.data.collate.collate(graph_list: list[GraphData]) dict [source]#
Concatenates attributes of multiple graphs based on the specifications of each GraphData.
By default, concatenates all default array attributes in dim 0 apart from edge_index which is concatenated along dim 1. Each graph remains independent in the final graph by incrementing the indices in edge_index based on the cumsum of previous number of nodes per graph.
- Parameters:
graph_list (
list
[GraphData
]) – List of GraphData objects to collate- Return type:
- Returns:
Dict containing all the attributes of the unified and disconnected big graph as well as the “private” attributes used behind the hood by the batching. These private attributes start with an underscore “_” and can be ignore by the user.