combine_graph_and_task

gli.dataloading.combine_graph_and_task(graph: DGLGraph | List[DGLGraph], task: GLITask) DGLDataset

Combine graph(s) and task to get a dataset.

gli.dataloading.combine_graph_and_task() loads task-specific information into the inputed graph(s) as additional attributes. The graph(s) is then further wrapped by a dgl.data.DGLDataset object.

Parameters:
  • graph (dgl.DGLGraph or list of dgl.DGLGraph.) – graph or a list of graphs.

  • task (gli.task.GLITask.) – predefined task configuration.

Return type:

dgl.data.DGLDataset.

Example

>>> g = get_gli_graph(dataset="cora")
>>> t = get_gli_task(dataset="cora", task="NodeClassification")
>>> d = combine_graph_and_task(g, t)
>>> d.name
'CORA dataset. NodeClassification'