GSgnnNodeDataLoaderBase

class graphstorm.dataloading.GSgnnNodeDataLoaderBase(dataset, target_idx, fanout)

Bases: object

The base dataloader class for node tasks.

If users want to customize the dataloader for node prediction tasks they should extend this base class by implementing the special methods __iter__ and __next__.

Parameters

datasetGSgnnNodeData

The dataset for the node task.

target_idxdict of Tensors

The target node IDs.

fanoutlist or dict of lists

The fanout for each GNN layer.

__iter__()

Returns an iterator object

__next__()

Return a mini-batch data for the node task.

A mini-batch comprises three objects: the input node IDs of the mini-batch, the target nodes and the subgraph blocks for message passing.

Returns

dict of Tensors : the input node IDs of the mini-batch. dict of Tensors : the target node IDs. list of DGLGraph : the subgraph blocks for message passing.