Lightning-AI / Lightning-AI/pytorch-lightning

support len(datamodule)

Open
#5,965 15 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

data handling feature good first issue help wanted
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.