I want to store the extracted graph information in DGLGraph format on a local disk,how should I do.
Specifically, I want to take a [(DGLgraph1, Label1)(DGLgraph2, Label2)…], such data stored locally
Hi,
# assume latest nightly build or 0.5 release
import dgl
import torch as th
g_list = [...100 DGLGraphs]
labels = t
# Save to files
dgl.save_graphs("graph.bin", g_list, {'labels': labels})
# Load from files
g_list, label_dict = dgl.load_graphs("graph.bin")
expected_list = zip(g_list, list(label_dict['labels']))
Does this work in your case?