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

Method __init__

src/diffusers/models/normalization.py:246–249  ·  view source on GitHub ↗
(self, dim)

Source from the content-addressed store, hash-verified

244class GlobalResponseNorm(nn.Module):
245 # Taken from https://github.com/facebookresearch/ConvNeXt-V2/blob/3608f67cc1dae164790c5d0aead7bf2d73d9719b/models/utils.py#L105
246 def __init__(self, dim):
247 super().__init__()
248 self.gamma = nn.Parameter(torch.zeros(1, 1, 1, dim))
249 self.beta = nn.Parameter(torch.zeros(1, 1, 1, dim))
250
251 def forward(self, x):
252 gx = torch.norm(x, p=2, dim=(1, 2), keepdim=True)

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected