BaseModule¶
- class mmengine.model.BaseModule(init_cfg=None)[source]¶
Base module for all modules in openmmlab.
BaseModuleis a wrapper oftorch.nn.Modulewith additional functionality of parameter initialization. Compared withtorch.nn.Module,BaseModulemainly adds three attributes.init_cfg: the config to control the initialization.init_weights: The function of parameter initialization and recording initialization information._params_init_info: Used to track the parameter initialization information. This attribute only exists during executing theinit_weights.
Note
PretrainedInithas a higher priority than any other initializer. The loaded pretrained weights will overwrite the previous initialized weights.