MCPcopy Create free account
hub / github.com/AlayaLab/Hive / load

Function load

models/flowsep/diffusers/models/modeling_utils.py:139–145  ·  view source on GitHub ↗
(module: torch.nn.Module, prefix="")

Source from the content-addressed store, hash-verified

137 # PyTorch's `_load_from_state_dict` does not copy parameters in a module's descendants
138 # so we need to apply the function recursively.
139 def load(module: torch.nn.Module, prefix=""):
140 args = (state_dict, prefix, {}, True, [], [], error_msgs)
141 module._load_from_state_dict(*args)
142
143 for name, child in module._modules.items():
144 if child is not None:
145 load(child, prefix + name + ".")
146
147 load(model_to_load)
148

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected