MCPcopy Create free account
hub / github.com/RightNow-AI/autokernel / softmax_ref

Function softmax_ref

reference.py:15–17  ·  view source on GitHub ↗

Standard softmax along dim.

(x: torch.Tensor, dim: int = -1)

Source from the content-addressed store, hash-verified

13
14# Softmax
15def 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
20def layernorm_ref(x: torch.Tensor, weight: torch.Tensor, bias: torch.Tensor, eps: float = 1e-5) -> torch.Tensor:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected