[dev] Auto register Configs upon import of hydra_configs.module.name
Write functions of the form:
hydra_configs.torch.register(), hydra_configs.torch.optim.register(), etc.
Within these functions, call config store API:
cs = ConfigStore.instance()
cs.store(name="adamconf", node=AdamConf)
Call these in __init__.py for the module.
I don't think we need to call them automatically.
- we should let users control what they register.
- registering is not free, the configs needs to be created. as the number of installed configs grow it can become expensive to blindly register all of them.
Don't the users have control by determining which 'module' they import?
What was your alternative proposition?
Users may import the packages to use the config objects directly as well.
import hydra_configs.pytrorch
#register everything under pytorch
hydra_configs.pytrorch.register()
#register everything under pytorch.optim
hydra_configs.pytrorch.optim.register()
Ok, I think this is probably a better option. The automatic strategy would likely leave users confused about what is and what isnt currently registered. Better to be explicit and convenient.
we can make register at the top level mean recursive to make things convenient.