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

Method _set_context

src/diffusers/hooks/hooks.py:268–275  ·  view source on GitHub ↗
(self, name: str | None = None)

Source from the content-addressed store, hash-verified

266 return module._diffusers_hook
267
268 def _set_context(self, name: str | None = None) -> None:
269 for hook_name in reversed(self._hook_order):
270 hook = self.hooks[hook_name]
271 if hook._is_stateful:
272 hook._set_context(self._module_ref, name)
273
274 for registry in self._get_child_registries():
275 registry._set_context(name)
276
277 def _get_child_registries(self) -> list["HookRegistry"]:
278 """Return registries of child modules, using a cached list when available.

Callers

nothing calls this directly

Calls 2

_get_child_registriesMethod · 0.95
_set_contextMethod · 0.45

Tested by

no test coverage detected