def from_config(
      cls,
      across_axes: dict[str, int],
      epsilon: float | jax.Array = 1e-6,
      dtype: jax.typing.DTypeLike = jnp.float32,
  ) -> LayerNorm:
    """Constructs a layer normalization layer.

    Args:
      across_axes: Names and lengths of the axes to normalize over.
      epsilon: Epsilon parameter for the standardization step.
      dtype: Dtype of the scale and shift parameters.

    Returns:
      A newly-constructed ``LayerNorm`` layer.
    """
    return cls([
        Standardize(across=tuple(across_axes.keys()), epsilon=epsilon),
        parameters.add_parameter_prefix(
            "scale",
            linear_and_affine.Linear.from_config(
                input_axes={},
                output_axes={},
                parallel_axes=across_axes,
                initializer=linear_and_affine.constant_initializer(1.0),
                dtype=dtype,
            ),
        ),
        parameters.add_parameter_prefix(
            "shift",
            linear_and_affine.AddBias.from_config(across_axes, dtype=dtype),
        ),
    ])
Constructs a layer normalization layer.

    Args:
      across_axes: Names and lengths of the axes to normalize over.
      epsilon: Epsilon parameter for the standardization step.
      dtype: Dtype of the scale and shift parameters.

    Returns:
      A newly-constructed ``LayerNorm`` layer.
    
penzai/deprecated/v1/nn/standardization.py