get_gli_graph

gli.dataloading.get_gli_graph(dataset: str, device: str = 'cpu', verbose: bool = False) DGLGraph | List[DGLGraph]

Get one (or a list of) dgl.DGLGraph object(s) from GLI repo.

If the loaded graph dataset contains a single graph, the returned value is a single dgl.DGLGraph object. Otherwise, if the dataset contains multiple graphs, the returned value is a list of dgl.DGLGraph objects.

Parameters:
  • dataset (str) – graph dataset name.

  • device (str, optional) – device name, defaults to “cpu”.

  • verbose (bool, optional) – verbose level, defaults to False.

Return type:

dgl.DGLGraph or list of dgl.DGLGraph.

Raises:

FileNotFoundError – Raised when metadata/task configuration file is not found.

Note

gli.dataloading.get_gli_graph() will download the data files if the data files do not exist in the local file system.

Examples

>>> g = gli.get_gli_graph("cora")
>>> g
Graph(num_nodes=2708, num_edges=10556,
    ndata_schemes={...}
    edata_schemes={})