(self, x, mask=None, pos_bias=None)
| 137 | num_buckets, num_heads, bidirectional=True) |
| 138 | |
| 139 | def forward(self, x, mask=None, pos_bias=None): |
| 140 | e = pos_bias if self.shared_pos else self.pos_embedding( |
| 141 | x.size(1), x.size(1)) |
| 142 | x = fp16_clamp(x + self.attn(self.norm1(x), mask=mask, pos_bias=e)) |
| 143 | x = fp16_clamp(x + self.ffn(self.norm2(x))) |
| 144 | return x |
| 145 | |
| 146 | |
| 147 | class T5RelativeEmbedding(nn.Module): |
nothing calls this directly
no test coverage detected