pub fn layer_norm<'a>(
x: impl AsRef<Array>,
weight: impl Into<Option<&'a Array>>,
bias: impl Into<Option<&'a Array>>,
eps: f32,
) -> Result<Array>
Expand description
Layer normalization.
The normalization is with respect to the last axis of the input x
.
ยงParams
- x: input array
- weight: A multiplicative weight to scale the result by. The
weight
should be one-dimensional with the same size as the last axis ofx
. If not given no scaling will occur. - bias: An additive offset to be added to the result. The
bias
should be one-dimensional with the same size as the last axis ofx
. It not given no offset will occur. - eps: A small additive constant for numerical stability
- stream: stream or device to evaluate on