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

Function _get_submodule_by_name

src/diffusers/hooks/context_parallel.py:357–360  ·  view source on GitHub ↗
(model: torch.nn.Module, name: str)

Source from the content-addressed store, hash-verified

355
356
357def _get_submodule_by_name(model: torch.nn.Module, name: str) -> torch.nn.Module | list[torch.nn.Module]:
358 if name.count("*") > 1:
359 raise ValueError("Wildcard '*' can only be used once in the name")
360 return _find_submodule_by_name(model, name)
361
362
363def _find_submodule_by_name(model: torch.nn.Module, name: str) -> torch.nn.Module | list[torch.nn.Module]:

Callers 2

apply_context_parallelFunction · 0.85
remove_context_parallelFunction · 0.85

Calls 1

_find_submodule_by_nameFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…