Skip to content

Commit

Permalink
Check download, process for class inheritance
Browse files Browse the repository at this point in the history
Noticed the problem described in issue pyg-team#4567 (closed) and saw the proposed fix. The fix (pyg-team#4586) doesn't check whether download or process exist, which the previous implementation does. Perhaps this change is closer to the intended behavior.
  • Loading branch information
pgmikhael authored Sep 16, 2022
1 parent 3b76bba commit 963b28e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions torch_geometric/data/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,12 @@ def __init__(self, root: Optional[str] = None,
self.pre_filter = pre_filter
self._indices: Optional[Sequence] = None

if self.download.__qualname__.split('.')[0] != 'Dataset':
download_method = getattr(self, "download", None)
if callable(download_method):
self._download()

if self.process.__qualname__.split('.')[0] != 'Dataset':

process_method = getattr(self, "process", None)
if callable(process_method):
self._process()

def indices(self) -> Sequence:
Expand Down

0 comments on commit 963b28e

Please sign in to comment.