Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Dataloading] Make loader iters iterator #2886

Merged
merged 5 commits into from
May 7, 2021
Merged

[Dataloading] Make loader iters iterator #2886

merged 5 commits into from
May 7, 2021

Conversation

justusschock
Copy link
Contributor

@justusschock justusschock commented May 4, 2021

Description

Makes all loader iters return self in __iter_ to enable type-checking with collections.abc.Iterator
This allows checks in Libraries like PyTorch Lightning (Lightning-AI/pytorch-lightning#7164)

Checklist

Please feel free to remove inapplicable items for your PR.

  • The PR title starts with [$CATEGORY] (such as [NN], [Model], [Doc], [Feature]])
  • Changes are complete (i.e. I finished coding on this PR)
  • All changes have test coverage
  • Code is well-documented
  • To the my best knowledge, examples are either not affected by this change,
    or have been fixed to be compatible with this change
  • Related issue is referred in this PR

Changes

  • Add __iter__ to all Iterators

@dgl-bot
Copy link
Collaborator

dgl-bot commented May 4, 2021

To trigger regression tests:

  • @dgl-bot run [instance-type] [which tests] [compare-with-branch];
    For example: @dgl-bot run g4dn.4xlarge all dmlc/master or @dgl-bot run c5.9xlarge kernel,api dmlc/master

@BarclayII
Copy link
Collaborator

Hi @justusschock , I actually noticed the same issue and have a similar fix in #2878. Your fix seems simpler (I don't know PL very well) so let me give this a try.

@BarclayII
Copy link
Collaborator

Worked like a charm. Thanks for your contribution! I'll incorporate your changes in my examples.

@BarclayII BarclayII merged commit bfef789 into dmlc:master May 7, 2021
BarclayII added a commit to BarclayII/dgl that referenced this pull request May 7, 2021
@justusschock
Copy link
Contributor Author

Hi @BarclayII, thanks for reviewing and merging. I am not that familiar with dgl, but I know PL very good. If you need help creating the examples feel free to ping me (on GH or the PL slack) :)

@justusschock justusschock deleted the patch-1 branch May 7, 2021 17:56
BarclayII added a commit that referenced this pull request May 11, 2021
* pytorch lightning initial examples

* revert most changes in dataloader to favor #2886.

* address comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants