MCPcopy Index your code
hub / github.com/huggingface/diffusers / initialize_hook

Method initialize_hook

src/diffusers/hooks/hooks.py:69–77  ·  view source on GitHub ↗

r""" Hook that is executed when a model is initialized. Args: module (`torch.nn.Module`): The module attached to this hook.

(self, module: torch.nn.Module)

Source from the content-addressed store, hash-verified

67 self.fn_ref: "HookFunctionReference" = None
68
69 def initialize_hook(self, module: torch.nn.Module) -> torch.nn.Module:
70 r"""
71 Hook that is executed when a model is initialized.
72
73 Args:
74 module (`torch.nn.Module`):
75 The module attached to this hook.
76 """
77 return module
78
79 def deinitalize_hook(self, module: torch.nn.Module) -> torch.nn.Module:
80 r"""

Callers 1

register_hookMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected