Load graphs and optionally their labels from file saved by
Besides loading from local files, DGL supports loading the graphs directly from S3 (by providing a
"s3://..."path) or from HDFS (by providing
graph_list (list[DGLGraph]) – The loaded graphs.
labels (dict[str, Tensor]) – The graph labels stored in file. If no label is stored, the dictionary is empty. Regardless of whether the
idx_listargument is given or not, the returned dictionary always contains the labels of all the graphs.
Following the example in
>>> from dgl.data.utils import load_graphs >>> glist, label_dict = load_graphs("./data.bin") # glist will be [g1, g2] >>> glist, label_dict = load_graphs("./data.bin", ) # glist will be [g1]