(self, x: Tensor)
| 15 | nn.init.constant_(self.weight, 1) |
| 16 | |
| 17 | def _norm(self, x: Tensor) -> Tensor: |
| 18 | return x * torch.rsqrt(x.pow(2).mean(-1, keepdim=True) + self.eps) |
| 19 | |
| 20 | def forward(self, x: Tensor) -> Tensor: |
| 21 | output = self._norm(x.float()).type_as(x) |