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

Method __init__

src/diffusers/models/normalization.py:213–226  ·  view source on GitHub ↗
(self, dim, eps: float, elementwise_affine: bool = True)

Source from the content-addressed store, hash-verified

211
212class RMSNorm(nn.Module):
213 def __init__(self, dim, eps: float, elementwise_affine: bool = True):
214 super().__init__()
215
216 self.eps = eps
217
218 if isinstance(dim, numbers.Integral):
219 dim = (dim,)
220
221 self.dim = torch.Size(dim)
222
223 if elementwise_affine:
224 self.weight = nn.Parameter(torch.ones(dim))
225 else:
226 self.weight = None
227
228 def forward(self, hidden_states):
229 input_dtype = hidden_states.dtype

Callers 7

__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected