Skip to content
fn

layer_norm_op

→TensorImplPtr
int layer_norm_op(const int & x, const int & gamma, const int & beta, double eps)

Python wrappers

Public Python APIs implemented by this engine symbol.

Public free-function entry point for Layer Normalization.

Thin wrapper that delegates to LayerNormBackward::forward. This is the symbol the pybind11 binding layer forwards to from lucid.nn.functional.layer_norm.

See Also

LayerNormBackward : Autograd node implementing the forward + backward. rms_norm_op : Variant that omits mean subtraction.

Parameters

xTensorImplPtr
Input tensor of any shape.
gammaTensorImplPtr
Per-element scale; must match the trailing dims of x.
betaTensorImplPtr
Per-element shift; same shape as gamma.
epsdouble
Numerical-stability constant.

Returns

TensorImplPtr

Normalised output, same shape as x.