MCPcopy Create free account
hub / github.com/TencentARC/BrushNet / load

Function load

src/diffusers/models/modeling_utils.py:171–177  ·  view source on GitHub ↗
(module: torch.nn.Module, prefix: str = "")

Source from the content-addressed store, hash-verified

169 # PyTorch's `_load_from_state_dict` does not copy parameters in a module's descendants
170 # so we need to apply the function recursively.
171 def load(module: torch.nn.Module, prefix: str = ""):
172 args = (state_dict, prefix, {}, True, [], [], error_msgs)
173 module._load_from_state_dict(*args)
174
175 for name, child in module._modules.items():
176 if child is not None:
177 load(child, prefix + name + ".")
178
179 load(model_to_load)
180

Callers 3

text2images.pyFile · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected