MCPcopy Create free account
hub / github.com/TencentARC/BrushNet / forward

Method forward

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

Source from the content-addressed store, hash-verified

139 self.linear = nn.Linear(embedding_dim, out_dim * 2)
140
141 def forward(self, x: torch.Tensor, emb: torch.Tensor) -> torch.Tensor:
142 if self.act:
143 emb = self.act(emb)
144 emb = self.linear(emb)
145 emb = emb[:, :, None, None]
146 scale, shift = emb.chunk(2, dim=1)
147
148 x = F.group_norm(x, self.num_groups, eps=self.eps)
149 x = x * (1 + scale) + shift
150 return x
151
152
153class AdaLayerNormContinuous(nn.Module):

Callers

nothing calls this directly

Calls 1

linearMethod · 0.80

Tested by

no test coverage detected