MCPcopy Create free account
hub / github.com/YesianRohn/TextSSR / __init__

Method __init__

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

Source from the content-addressed store, hash-verified

249 """
250
251 def __init__(
252 self, embedding_dim: int, out_dim: int, num_groups: int, act_fn: Optional[str] = None, eps: float = 1e-5
253 ):
254 super().__init__()
255 self.num_groups = num_groups
256 self.eps = eps
257
258 if act_fn is None:
259 self.act = None
260 else:
261 self.act = get_activation(act_fn)
262
263 self.linear = nn.Linear(embedding_dim, out_dim * 2)
264
265 def forward(self, x: torch.Tensor, emb: torch.Tensor) -> torch.Tensor:
266 if self.act:

Callers

nothing calls this directly

Calls 2

get_activationFunction · 0.85
__init__Method · 0.45

Tested by

no test coverage detected