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

Method initialize_hook

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

Source from the content-addressed store, hash-verified

293 self._metadata = None
294
295 def initialize_hook(self, module):
296 unwrapped_module = unwrap_module(module)
297 self._metadata = TransformerBlockRegistry.get(unwrapped_module.__class__)
298 return module
299
300 @torch.compiler.disable
301 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