Method
forward
(
self,
x: torch.Tensor,
start_pos: int,
mask: Optional[torch.Tensor],
)
Source from the content-addressed store, hash-verified
| 239 | # self.post_attention_layernorm = nn.LayerNorm(args.dim, eps=args.norm_eps) |
| 240 | |
| 241 | def forward( |
| 242 | self, |
| 243 | x: torch.Tensor, |
| 244 | start_pos: int, |
| 245 | mask: Optional[torch.Tensor], |
| 246 | ): |
| 247 | layernorm_output = self.input_layernorm(x) |
| 248 | h_attn = x + self.self_attention.forward(layernorm_output, start_pos, mask) |
| 249 | h_mlp = self.mlp(layernorm_output) |
| 250 | out = h_attn + h_mlp |
| 251 | return out |
| 252 | |
| 253 | |
| 254 | class Transformer(nn.Module): |
Callers
nothing calls this directly
Tested by
no test coverage detected