MCPcopy Create free account
hub / github.com/FunAudioLLM/SenseVoice / LayerNorm

Class LayerNorm

model.py:268–280  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

266
267
268class LayerNorm(nn.LayerNorm):
269 def __init__(self, *args, **kwargs):
270 super().__init__(*args, **kwargs)
271
272 def forward(self, input):
273 output = F.layer_norm(
274 input.float(),
275 self.normalized_shape,
276 self.weight.float() if self.weight is not None else None,
277 self.bias.float() if self.bias is not None else None,
278 self.eps,
279 )
280 return output.type_as(input)
281
282
283def sequence_mask(lengths, maxlen=None, dtype=torch.float32, device=None):

Callers 2

__init__Method · 0.85
__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected