A plain old python object modeling a batch of graphs as one big
A plain old python object modeling a batch of graphs as one big (dicconnected) graph. With
cogdl.data.Databeing the base class, all its methods can also be used here. In addition, single graphs can be reconstructed via the assignment vector
batch, which maps each node to its respective graph identifier.
Constructs a batch object from a python list holding
torch_geometric.data.Dataobjects. The assignment vector
batchis created on the fly. Additionally, creates assignment batch vectors for each key in
cumsum(self, key, item)¶
True, the attribute
itemshould be added up cumulatively before concatenated together.
This method is for internal use only, and should only be overridden if the batch concatenation process is corrupted for a specific data attribute.
Reconstructs the list of
torch_geometric.data.Dataobjects from the batch object. The batch object must have been created via
from_data_list()in order to be able reconstruct the initial objects.
Returns the number of graphs in the batch.