The core conception of LazyConfig is 'Lazy', which represents a status of delay. Before instantiating, all the parameters will be stored in a special dict which additionally contains what the target class is. So It's easy to alter any parameters of the module and control which module should be instantiated and which module should not.
What's the impact
Provide 2 way to build modules:
call config.build_all and use config hooks to handle sth.
use LazyCconfig object and handle special needs manually in user code
What to do
Switch to LazyConfig.
What is LazyConfig
The core conception of
LazyConfig
is 'Lazy', which represents a status ofdelay
. Before instantiating, all the parameters will be stored in a special dict which additionally contains what the target class is. So It's easy to alter any parameters of the module and control which module should be instantiated and which module should not.What's the impact
Provide 2 way to build modules:
LazyCconfig
object and handle special needs manually in user code