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

Function load

PATH/core/models/backbones/vit.py:635–647  ·  view source on GitHub ↗
(module, prefix='')

Source from the content-addressed store, hash-verified

633
634 # use _load_from_state_dict to enable checkpoint version control
635 def load(module, prefix=''):
636 # recursively check parallel module in case that the model has a
637 # complicated structure, e.g., nn.Module(nn.Module(DDP))
638 # if is_module_wrapper(module):
639 # module = module.module
640 local_metadata = {} if metadata is None else metadata.get(
641 prefix[:-1], {})
642 module._load_from_state_dict(state_dict, prefix, local_metadata, True,
643 all_missing_keys, unexpected_keys,
644 err_msg)
645 for name, child in module._modules.items():
646 if child is not None:
647 load(child, prefix + name + '.')
648
649 load(module)
650 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