code wiki / (root) / nx_f32_layernorm.nx

nx_f32_layernorm.nx

buildroot/runtime/nx_f32_layernorm.nx

1484 B34 linesdepth 4pulls 6 transitivereach 4 importersview sourcekind librarytopic f32
docsdependenciesstructsconstsfunctions

about

nx_f32_layernorm.nx -- clean importable flat-array software-f32 LayerNorm (per-row normalize over `dim`, then affine): out = (x-mean)/sqrt(var+eps) * gamma + beta. The ecosystem has nx_layernorm_forward (NxTensor) and a layernorm_fwd embedded in a gate, but no plain importable flat lib -- this is it, the ViT/BERT encoder building block. Composes nx_f32_add/sub/mul/div/sqrt. license_tier: ORIGINAL

dependencies 4 imports · 3 importers

nx_syscalls.nx nx_f32.nx nx_f32_cvt.nx nx_f32_div.nx nx_f32_layernorm.nx nx_f32_layernorm_lib_gate.nx nx_vit_encoder_layer.nx nx_vitpose_forward.nx

imports: nx_syscalls.nxnx_f32.nxnx_f32_cvt.nxnx_f32_div.nx

imported by: nx_f32_layernorm_lib_gate.nxnx_vit_encoder_layer.nxnx_vitpose_forward.nx

structs

none

consts

none

functions

11func nx_f32_layernorm(x: *i64, gamma: *i64, beta: *i64, n_rows: i64, dim: i64, eps: i64, out: *i64) -> i64