(self, tensor, seq_len: int, bsz: int)
| 372 | self.out_proj = Linear(self.embed_dim, self.embed_dim) |
| 373 | |
| 374 | def _shape(self, tensor, seq_len: int, bsz: int): |
| 375 | return tensor.reshape(bsz, seq_len, self.num_heads, self.head_dim).permute(0,2,1,3) |
| 376 | |
| 377 | def __call__(self, hidden_states, causal_attention_mask): |
| 378 | bsz, tgt_len, embed_dim = hidden_states.shape |