MCPcopy Index your code
hub / github.com/SooLab/CGFormer / load

Method load

bert/modeling_utils.py:736–743  ·  view source on GitHub ↗
(module: nn.Module, prefix="")

Source from the content-addressed store, hash-verified

734 # PyTorch's `_load_from_state_dict` does not copy parameters in a module's descendants
735 # so we need to apply the function recursively.
736 def load(module: nn.Module, prefix=""):
737 local_metadata = {} if metadata is None else metadata.get(prefix[:-1], {})
738 module._load_from_state_dict(
739 state_dict, prefix, local_metadata, True, missing_keys, unexpected_keys, error_msgs,
740 )
741 for name, child in module._modules.items():
742 if child is not None:
743 load(child, prefix + name + ".")
744
745 # Make sure we are able to load base models as well as derived models (with heads)
746 start_prefix = ""

Callers 10

main_workerFunction · 0.80
mainFunction · 0.80
__init__Method · 0.80
folder2lmdb.pyFile · 0.80
load_pavimodel_distFunction · 0.80
load_fileclient_distFunction · 0.80
_load_checkpointFunction · 0.80
from_pretrainedMethod · 0.80
filename_to_urlFunction · 0.80
_from_pretrainedMethod · 0.80

Calls 2

loadFunction · 0.85
itemsMethod · 0.80

Tested by 1

mainFunction · 0.64