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

Method forward

diffusers/src/diffusers/models/normalization.py:265–274  ·  view source on GitHub ↗
(self, x: torch.Tensor, emb: torch.Tensor)

Source from the content-addressed store, hash-verified

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:
267 emb = self.act(emb)
268 emb = self.linear(emb)
269 emb = emb[:, :, None, None]
270 scale, shift = emb.chunk(2, dim=1)
271
272 x = F.group_norm(x, self.num_groups, eps=self.eps)
273 x = x * (1 + scale) + shift
274 return x
275
276
277class AdaLayerNormContinuous(nn.Module):

Callers

nothing calls this directly

Calls 1

linearMethod · 0.80

Tested by

no test coverage detected