(self, x: torch.Tensor)
| 76 | self.dim = dim |
| 77 | |
| 78 | def forward(self, x: torch.Tensor) -> torch.Tensor: |
| 79 | # x: [..., dim] |
| 80 | rms = x.pow(2).mean(dim=-1, keepdim=True).add(self.eps).sqrt() |
| 81 | return x / rms |
| 82 | |
| 83 | |
| 84 | # ────────────────────────────────────────────────────────────────────────────── |
nothing calls this directly
no outgoing calls
no test coverage detected