Method
__init__
(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 | |
| 178 | class NoPositionalEncoding(torch.nn.Module): |
Callers
nothing calls this directly
Tested by
no test coverage detected