I’ve come across a few points while working on the dataloading pipeline, and I would really appreciate some guidance:
- A standard PyTorch DataLoader requires a customized class to have a method named
pin_memoryto utilize it.
dgl.DGLGraphhas a method called
dgl.dataloading.dataloader.GraphDataLoaderclass doesn’t seem to do anything particular with this.
I’m currently working with small graphs, and my approach involves batching the graphs in a customized
torch.utils.data.DataLoader. Now, I’m wondering if I should call
batched_graph.pin_memory_() before returning it, or should I just return features separately (like
return batched_graph, node_feature, edge_feature, graph_feature)? What would be the best practice that you recommend?