pub struct Normalize<'src, 'dst> { /* private fields */ }
Expand description
Normalize the mean and variance of elements in a slice.
This normalizes elements according to the formula:
output[i] = (input[i] - pre_scale_bias) * scale * element_scale[i] + bias + element_bias[i]
§Panics
Dispatching the operation panics if any of the slices have different lengths.
Implementations§
Source§impl<'src, 'dst> Normalize<'src, 'dst>
impl<'src, 'dst> Normalize<'src, 'dst>
Sourcepub fn new(
input: &'src [f32],
output: &'dst mut [MaybeUninit<f32>],
opts: NormalizeOptions<'src>,
) -> Self
pub fn new( input: &'src [f32], output: &'dst mut [MaybeUninit<f32>], opts: NormalizeOptions<'src>, ) -> Self
Create a normalize operation which reads input
and writes the normalized
output to output
.
Sourcepub fn new_mut(input: &'dst mut [f32], opts: NormalizeOptions<'src>) -> Selfwhere
'dst: 'src,
pub fn new_mut(input: &'dst mut [f32], opts: NormalizeOptions<'src>) -> Selfwhere
'dst: 'src,
Create a normalize operation which normalizes input
in-place.
Trait Implementations§
Auto Trait Implementations§
impl<'src, 'dst> Freeze for Normalize<'src, 'dst>
impl<'src, 'dst> RefUnwindSafe for Normalize<'src, 'dst>
impl<'src, 'dst> Send for Normalize<'src, 'dst>
impl<'src, 'dst> Sync for Normalize<'src, 'dst>
impl<'src, 'dst> Unpin for Normalize<'src, 'dst>
impl<'src, 'dst> !UnwindSafe for Normalize<'src, 'dst>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more