def __init__(self, load_path: str, load_dict: Dict, name: Optional[str]=None, map_location: Optional[Dict]=None) -> None:
    assert (load_path is not None), 'must provide clear path to load checkpoint.'
    self.load_path = load_path
    assert ((load_dict is not None) and (len(load_dict) > 0)), 'must provide target objects to load.'
    self.logger = logging.getLogger(name)
    for (k, v) in load_dict.items():
        if hasattr(v, 'module'):
            load_dict[k] = v.module
    self.load_dict = load_dict
    self._name = name
    self.map_location = map_location
def __init__(self, load_path: str, load_dict: Dict, name: Optional[str]=None, map_location: Optional[Dict]=None) -> None:
    assert (load_path is not None), 'must provide clear path to load checkpoint.'
    self.load_path = load_path
    assert ((load_dict is not None) and (len(load_dict) > 0)), 'must provide target objects to load.'
    self.logger = logging.getLogger(name)
    for (k, v) in load_dict.items():
        if hasattr(v, 'module'):
            load_dict[k] = v.module
    self.load_dict = load_dict
    self._name = name
    self.map_location = map_location