Struct syntaxdot_transformers::layers::LayerNorm
source · pub struct LayerNorm { /* private fields */ }
Expand description
Layer that applies layer normalization.
Implementations§
source§impl LayerNorm
impl LayerNorm
sourcepub fn new<'a>(
vs: impl Borrow<PathExt<'a>>,
normalized_shape: impl Into<Vec<i64>>,
eps: f64,
elementwise_affine: bool
) -> Self
pub fn new<'a>(
vs: impl Borrow<PathExt<'a>>,
normalized_shape: impl Into<Vec<i64>>,
eps: f64,
elementwise_affine: bool
) -> Self
Construct a layer normalization layer.
The mean and standard deviation are computed over the last
number of dimensions with the shape defined by
normalized_shape
. If elementwise_affine
is True
, a
learnable affine transformation of the shape
normalized_shape
is added after normalization.