MCPcopy Create free account
hub / github.com/OpenGVLab/HumanBench / load

Function load

PATH/core/models/backbones/vitdet.py:739–751  ·  view source on GitHub ↗
(module, prefix='')

Source from the content-addressed store, hash-verified

737
738 # use _load_from_state_dict to enable checkpoint version control
739 def load(module, prefix=''):
740 # recursively check parallel module in case that the model has a
741 # complicated structure, e.g., nn.Module(nn.Module(DDP))
742 # if is_module_wrapper(module):
743 # module = module.module
744 local_metadata = {} if metadata is None else metadata.get(
745 prefix[:-1], {})
746 module._load_from_state_dict(state_dict, prefix, local_metadata, True,
747 all_missing_keys, unexpected_keys,
748 err_msg)
749 for name, child in module._modules.items():
750 if child is not None:
751 load(child, prefix + name + '.')
752
753 load(module)
754 load = None # break load->load reference cycle

Callers 1

load_state_dictFunction · 0.70

Calls 2

getMethod · 0.80
_load_from_state_dictMethod · 0.80

Tested by

no test coverage detected