(self, x)
| 64 | self.weight = nn.Parameter(torch.ones(dim)) |
| 65 | |
| 66 | def forward(self, x): |
| 67 | x = x * torch.rsqrt(x.float().pow(2).mean(dim=-1, keepdim=True) + |
| 68 | self.eps) |
| 69 | if self.weight.dtype in [torch.float16, torch.bfloat16]: |
| 70 | x = x.type_as(self.weight) |
| 71 | return self.weight * x |
| 72 | |
| 73 | |
| 74 | class T5Attention(nn.Module): |
nothing calls this directly
no outgoing calls
no test coverage detected