(self, input)
| 47 | self.register_buffer("inv_freq", inv_freq) |
| 48 | |
| 49 | def forward(self, input): |
| 50 | shape = input.shape |
| 51 | sinusoid_in = torch.ger(input.view(-1).float(), self.inv_freq) |
| 52 | pos_emb = torch.cat([sinusoid_in.sin(), sinusoid_in.cos()], dim=-1) |
| 53 | pos_emb = pos_emb.view(*shape, self.dim) |
| 54 | return pos_emb |
| 55 | |
| 56 | |
| 57 | class Swish(nn.Module): |
nothing calls this directly
no outgoing calls
no test coverage detected