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

Method reset_state

src/diffusers/hooks/hooks.py:130–133  ·  view source on GitHub ↗
(self, module: torch.nn.Module)

Source from the content-addressed store, hash-verified

128 return module
129
130 def reset_state(self, module: torch.nn.Module):
131 if self._is_stateful:
132 raise NotImplementedError("This hook is stateful and needs to implement the `reset_state` method.")
133 return module
134
135 def _set_context(self, module: torch.nn.Module, name: str) -> None:
136 # Iterate over all attributes of the hook to see if any of them have the type `StateManager`. If so, call `set_context` on them.

Callers 1

reset_stateful_hooksMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected