For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).
Mojo struct
LayerNorm
struct LayerNorm
Registers the mo.reduce.layer_norm graph op with the graph compiler.
Implemented traits
Methods
execute
static def execute(output: T, input: T, gamma: T, beta: T, epsilon: Float32, ctx: DeviceContext)
Executes the mo.reduce.layer_norm graph op.
Args:
- output (
T): Output tensor receiving the result. - input (
T): Input tensor to reduce. - gamma (
T): Per-column scale weights. - beta (
T): Per-column shift weights. - epsilon (
Float32): Small constant for numerical stability. - ctx (
DeviceContext): Device context used to enqueue the kernel.
Raises:
Error: If the operation parameters are invalid.