Transform operation changes dataset whenever __getitem__ is called


I am trying to use the builtin TUDataset with DropNode transform. It seems DropNode performs a in-place transform on self.graph_lists[idx] in getitem. Therefore, after several iterations of calling data[0] for example, data[0]'s graph has less and less nodes until becomes empty.

Do I use the dataset or the transform operation in a wrong way? Or how could I avoid the in-place changes so that each time data[0] is called, DropNode is performed on the original graph?

Thanks a lot.

Thank you for the report. I think this is a bug and I will fix it soon.

OK, I see. Thank you Mufei. :handshake:

This issue is now tracked on GitHub: Transform Module DropNode and DropEdge affect original graphs · Issue #4495 · dmlc/dgl · GitHub

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

This has been fixed in [Transform] Fix graph structure corruption with transform by mufeili · Pull Request #4753 · dmlc/dgl · GitHub