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

Method forward

src/diffusers/models/normalization.py:178–182  ·  view source on GitHub ↗
(self, x: torch.Tensor, conditioning_embedding: torch.Tensor)

Source from the content-addressed store, hash-verified

176 raise ValueError(f"unknown norm_type {norm_type}")
177
178 def forward(self, x: torch.Tensor, conditioning_embedding: torch.Tensor) -> torch.Tensor:
179 emb = self.linear(self.silu(conditioning_embedding))
180 scale, shift = torch.chunk(emb, 2, dim=1)
181 x = self.norm(x) * (1 + scale)[:, None, :] + shift[:, None, :]
182 return x
183
184
185if is_torch_version(">=", "2.1.0"):

Callers

nothing calls this directly

Calls 1

linearMethod · 0.80

Tested by

no test coverage detected