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

Method __init__

src/diffusers/models/normalization.py:281–293  ·  view source on GitHub ↗
(
        self, embedding_dim: int, out_dim: int, num_groups: int, act_fn: str | None = None, eps: float = 1e-5
    )

Source from the content-addressed store, hash-verified

279 """
280
281 def __init__(
282 self, embedding_dim: int, out_dim: int, num_groups: int, act_fn: str | None = None, eps: float = 1e-5
283 ):
284 super().__init__()
285 self.num_groups = num_groups
286 self.eps = eps
287
288 if act_fn is None:
289 self.act = None
290 else:
291 self.act = get_activation(act_fn)
292
293 self.linear = nn.Linear(embedding_dim, out_dim * 2)
294
295 def forward(self, x: torch.Tensor, emb: torch.Tensor) -> torch.Tensor:
296 if self.act:

Callers

nothing calls this directly

Calls 2

get_activationFunction · 0.85
__init__Method · 0.45

Tested by

no test coverage detected