y 即文本上下文(未做其他分支)。
(self, x: torch.Tensor, y: torch.Tensor, is_stream: bool = False)
| 417 | self.cache_v = None |
| 418 | |
| 419 | def forward(self, x: torch.Tensor, y: torch.Tensor, is_stream: bool = False): |
| 420 | """ |
| 421 | y 即文本上下文(未做其他分支)。 |
| 422 | """ |
| 423 | q = self.norm_q(self.q(x)) |
| 424 | assert self.cache_k is not None and self.cache_v is not None |
| 425 | k = self.cache_k |
| 426 | v = self.cache_v |
| 427 | |
| 428 | x = self.attn(q, k, v) |
| 429 | return self.o(x) |
| 430 | |
| 431 | |
| 432 | class GateModule(nn.Module): |
nothing calls this directly
no outgoing calls
no test coverage detected