BaseModule — mmengine 0.10.7 documentation (original) (raw)

class mmengine.model.BaseModule(init_cfg=None)[source]

Base module for all modules in openmmlab. BaseModule is a wrapper oftorch.nn.Module with additional functionality of parameter initialization. Compared with torch.nn.Module, BaseModule mainly adds three attributes.

Note

PretrainedInit has a higher priority than any other initializer. The loaded pretrained weights will overwrite the previous initialized weights.

Parameters:

init_cfg (dict or List _[_dict] , optional) – Initialization config dict.

init_weights()[source]

Initialize the weights.