MCPcopy Create free account
hub / github.com/huggingface/diffusers / initialize_hook

Method initialize_hook

src/diffusers/hooks/mag_cache.py:179–182  ·  view source on GitHub ↗
(self, module)

Source from the content-addressed store, hash-verified

177 self._metadata = None
178
179 def initialize_hook(self, module):
180 unwrapped_module = unwrap_module(module)
181 self._metadata = TransformerBlockRegistry.get(unwrapped_module.__class__)
182 return module
183
184 @torch.compiler.disable
185 def new_forward(self, module: torch.nn.Module, *args, **kwargs):

Callers

nothing calls this directly

Calls 2

unwrap_moduleFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected