Initialize BaseModule, inherited from `torch.nn.Module`
(self, init_cfg: Union[dict, List[dict], None] = None)
| 37 | """ |
| 38 | |
| 39 | def __init__(self, init_cfg: Union[dict, List[dict], None] = None): |
| 40 | """Initialize BaseModule, inherited from `torch.nn.Module`""" |
| 41 | |
| 42 | # NOTE init_cfg can be defined in different levels, but init_cfg |
| 43 | # in low levels has a higher priority. |
| 44 | |
| 45 | super().__init__() |
| 46 | # define default value of init_cfg instead of hard code |
| 47 | # in init_weights() function |
| 48 | self._is_init = False |
| 49 | |
| 50 | self.init_cfg = copy.deepcopy(init_cfg) |
| 51 | |
| 52 | # Backward compatibility in derived classes |
| 53 | # if pretrained is not None: |
| 54 | # warnings.warn('DeprecationWarning: pretrained is a deprecated \ |
| 55 | # key, please consider using init_cfg') |
| 56 | # self.init_cfg = dict(type='Pretrained', checkpoint=pretrained) |
| 57 | |
| 58 | @property |
| 59 | def is_init(self): |