-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Add support for len(datamodule)
#9895
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
Add support for len(datamodule)
#9895
Conversation
The two truth value tests in
I think it is because no Let me know how I should fix this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGMT !
Codecov Report
@@ Coverage Diff @@
## master #9895 +/- ##
=======================================
- Coverage 93% 89% -4%
=======================================
Files 178 179 +1
Lines 15642 15826 +184
=======================================
- Hits 14486 14048 -438
- Misses 1156 1778 +622 |
pytorch_lightning/core/datamodule.py
Outdated
|
||
def get_num_batches(dataloader: DataLoader) -> None: | ||
nonlocal num_batches | ||
L = len(dataloader) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's use descriptive, lowercase variable names :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
len(datamodule)
pytorch_lightning/core/datamodule.py
Outdated
|
||
def get_num_batches(dataloader: DataLoader) -> None: | ||
nonlocal num_batches | ||
L = len(dataloader) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's use descriptive, lowercase variable names :)
Co-authored-by: tchaton <[email protected]>
This reverts commit 6429de8.
This reverts commit 6429de8.
This reverts commit 6429de8.
What does this PR do?
Fixes #5965
Does your PR introduce any breaking changes? If yes, please list them.
Before submitting
PR review
Anyone in the community is welcome to review the PR.
Before you start reviewing make sure you have read Review guidelines. In short, see the following bullet-list:
Did you have fun?
Make sure you had fun coding 🙃