mlx.core.fast.rms_norm

目錄

mlx.core.fast.rms_norm#

rms_norm(x: array, weight: array | None, eps: float, *, stream: None | Stream | Device = None) array#

均方根正規化(RMS norm)。

The normalization is with respect to the last axis of the input x.

參數:
  • x (array) -- Input array.

  • weight (array, optional) -- A multiplicative weight to scale the result by. The weight should be one-dimensional with the same size as the last axis of x. If set to None then no scaling happens.

  • eps (float) -- A small additive constant for numerical stability.

回傳:

The output array.

回傳型別:

array