Support multiple levels of subclassing in from_argparse_args
#3315
Labels
feature
Is an improvement or enhancement
help wanted
Open to be worked on
won't fix
This will not be worked on
🚀 Feature
Improve
from_argparse_args
methods inLightningDataModule
andTrainer
so that they can support more than one level of subclassing from their base Lightning class.Motivation
Users might want to develop a custom hierarchy of subclasses to either
LigthingDataModule
orTrainer
to deal with common/boilerplate code (e.g. systematically add common arguments to data modules likebatch_size
ornum_workers
). However, the genericfrom_argparse_args
methods fail them in this case, and users must implement by hand a custom initialization logic.Pitch
It would be easy to implement a recursive inspection of the parent's init signature to include its args as well until we hit the base Lightning class.
Edit: To help discuss the issue, I opened a draft PR #3316 which already implements the desired behavior.
The text was updated successfully, but these errors were encountered: