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

Method forward

src/diffusers/models/normalization.py:44–48  ·  view source on GitHub ↗
(self, x: torch.Tensor, timestep: torch.Tensor)

Source from the content-addressed store, hash-verified

42 self.norm = nn.LayerNorm(embedding_dim, elementwise_affine=False)
43
44 def forward(self, x: torch.Tensor, timestep: torch.Tensor) -> torch.Tensor:
45 emb = self.linear(self.silu(self.emb(timestep)))
46 scale, shift = torch.chunk(emb, 2)
47 x = self.norm(x) * (1 + scale) + shift
48 return x
49
50
51class AdaLayerNormZero(nn.Module):

Callers

nothing calls this directly

Calls 1

linearMethod · 0.80

Tested by

no test coverage detected