Lightning-AI / Lightning-AI/pytorch-lightning
support len(datamodule)
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 31.4k
- Forks
- 3.8k
- Avg merge
- 6d 7h
- Merged PRs (30d)
- 6
Description
Let's add support for len(datamodule) so we can get the following:
```python
len(datamodule)
# prints:
# train_dataloder_1: 200 samples
# train_dataloader_2: 500 samples
# tval_dataloder_1: 200 samples
# val_dataloader_2: 500 samples
# test_dataloder_1: 200 samples
# test_dataloader_2: 500 samples
```
cc @edenafek
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the datamodule entry point and how its train, validation, and test dataloaders are constructed. Clarify whether len(datamodule) should return one value or report the sample counts for each loader, then add coverage showing the requested output for multiple loaders and verify the existing dataloader behavior remains unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- data, machine-learning
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100