MCPcopy Create free account
hub / github.com/YesianRohn/TextSSR / FP32LayerNorm

Class FP32LayerNorm

diffusers/src/diffusers/models/normalization.py:88–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86
87
88class FP32LayerNorm(nn.LayerNorm):
89 def forward(self, inputs: torch.Tensor) -> torch.Tensor:
90 origin_dtype = inputs.dtype
91 return F.layer_norm(
92 inputs.float(),
93 self.normalized_shape,
94 self.weight.float() if self.weight is not None else None,
95 self.bias.float() if self.bias is not None else None,
96 self.eps,
97 ).to(origin_dtype)
98
99
100class AdaLayerNormZero(nn.Module):

Callers 6

__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected