(self, text)
| 75 | return mask |
| 76 | |
| 77 | def forward(self, text): |
| 78 | x = self.token_embedding(text) |
| 79 | x = x + self.positional_embedding |
| 80 | x = x.permute(1, 0, 2) |
| 81 | x = self.transformer(x) |
| 82 | x = x.permute(1, 0, 2) |
| 83 | x = self.ln_final(x) |
| 84 | x = x[torch.arange(x.shape[0]), text.argmax(dim=-1)] @ self.text_projection |
| 85 | # x = self.text_projection(x[torch.arange(x.shape[0]), text.argmax(dim=-1)]) |
| 86 | return x |
nothing calls this directly
no outgoing calls
no test coverage detected