Batch

Batching multiple graphs into a single disconnected graph (PyG-style).

FunctionDescription
batch graphsCombine a list of graphs into one batched graph.
Node features are concatenated along dim 0.
Edge indices are offset by cumulative node counts.
A batch vector [N_total] maps each node to its source graph index.
numGraphs gReturn the number of graphs in a batched graph.

batch

batch graphs

Combine a list of graphs into one batched graph. Node features are concatenated along dim 0. Edge indices are offset by cumulative node counts. A batch vector [N_total] maps each node to its source graph index.

Parameters

  • graphs : GraphData array

Returns GraphData


numGraphs

numGraphs g

Return the number of graphs in a batched graph.

Parameters

  • g : GraphData

Returns int64