Standard softmax along dim.
(x: torch.Tensor, dim: int = -1)
| 13 | |
| 14 | # Softmax |
| 15 | def softmax_ref(x: torch.Tensor, dim: int = -1) -> torch.Tensor: |
| 16 | """Standard softmax along dim.""" |
| 17 | return F.softmax(x, dim=dim) |
| 18 | |
| 19 | # Layer Normalization |
| 20 | def layernorm_ref(x: torch.Tensor, weight: torch.Tensor, bias: torch.Tensor, eps: float = 1e-5) -> torch.Tensor: |
nothing calls this directly
no outgoing calls
no test coverage detected