MCPcopy Create free account
hub / github.com/ASLP-lab/OSUM / __init__

Method __init__

OSUM/wenet/transformer/embedding.py:171–175  ·  view source on GitHub ↗
(self, d_model: int, dropout_rate: float, max_len: int = 448)

Source from the content-addressed store, hash-verified

169 """
170
171 def __init__(self, d_model: int, dropout_rate: float, max_len: int = 448):
172 super().__init__(d_model, dropout_rate, max_len)
173 # NOTE(xcsong): overwrite self.pe & self.xscale
174 self.pe = torch.nn.Parameter(torch.empty(1, max_len, d_model))
175 self.xscale = 1.0
176
177
178class NoPositionalEncoding(torch.nn.Module):

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected