Normalization module wrappers #
This file wraps selected normalization specs as Spec.Modules for composition/export.
For Spec.Module.layerNorm, the final axis is the feature axis and every preceding axis is treated
as a batch axis. The implementation flattens those leading axes only while applying the
matrix-level normalization semantics.
PyTorch mental picture: nn.LayerNorm(embedDim) applied at each timestep, with weight=gamma and
bias=beta.
LayerNorm over the final axis, wrapped as a Spec.Module.
The epsilon is passed unchanged to Spec.layerNorm; there is no representability check or
fallback when it rounds to zero. Tiny formats may require an explicitly chosen positive finite
epsilon. The Python expression records only the width, omitting the supplied epsilon and affine
parameters.