Skip to content

Support str(datamodule) #9947

@carmocca

Description

@carmocca

🚀 Feature

Add support

print(str(MyDataModule()))

Motivation

It currently prints:

<__main__.MyDataModule object at 0x10284c970>

Pitch

It could print the DataLoader structure:

MyDataModule(
    train_dataloader: {"a": DataLoaderClass(batch_size=8, num_batches=16, num_workers=2), "b":  DataLoaderClass(batch_size=2, num_batches=16, num_workers=2)]
    val_dataloader: [DataLoaderClass(batch_size=3, num_batches=14, num_workers=0), DataLoaderClass(batch_size=8, num_batches=4, num_workers=0)]
    test_dataloader: DataLoaderClass(batch_size=4, num_batches=7, num_workers=2)
)

Or the number of batches per dataloader, similar to what was done in #5965

Alternatives

Open to other ideas


If you enjoy Lightning, check out our other projects! ⚡

  • Metrics: Machine learning metrics for distributed, scalable PyTorch applications.

  • Flash: The fastest way to get a Lightning baseline! A collection of tasks for fast prototyping, baselining, finetuning and solving problems with deep learning

  • Bolts: Pretrained SOTA Deep Learning models, callbacks and more for research and production with PyTorch Lightning and PyTorch

  • Lightning Transformers: Flexible interface for high performance research using SOTA Transformers leveraging Pytorch Lightning, Transformers, and Hydra.

Metadata

Metadata

Assignees

Labels

data handlingGeneric data-related topicfeatureIs an improvement or enhancementgood first issueGood for newcomers

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions