Struct syntaxdot_transformers::layers::LayerNorm
source · [−]pub struct LayerNorm { /* private fields */ }
Expand description
Layer that applies layer normalization.
Implementations
sourceimpl 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.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for LayerNorm
impl Send for LayerNorm
impl !Sync for LayerNorm
impl Unpin for LayerNorm
impl UnwindSafe for LayerNorm
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more