Struct icu_segmenter::complex::lstm::matrix::MatrixBorrowedMut
source · pub(super) struct MatrixBorrowedMut<'a, const D: usize> {
pub(super) data: &'a mut [f32],
pub(super) dims: [usize; D],
}
Expand description
A D
-dimensional, mutably borrowed matrix.
Fields§
§data: &'a mut [f32]
§dims: [usize; D]
Implementations§
source§impl<'a, const D: usize> MatrixBorrowedMut<'a, D>
impl<'a, const D: usize> MatrixBorrowedMut<'a, D>
pub(super) fn as_borrowed(&self) -> MatrixBorrowed<'_, D>
pub(super) fn as_mut_slice(&mut self) -> &mut [f32]
pub(super) fn copy_submatrix<const M: usize>(&mut self, from: usize, to: usize)
pub(super) fn add(&mut self, other: MatrixZero<'_, D>) -> Option<()>
sourcepub(super) fn softmax_transform(&mut self)
pub(super) fn softmax_transform(&mut self)
Mutates this matrix by applying a softmax transformation.
pub(super) fn sigmoid_transform(&mut self)
pub(super) fn tanh_transform(&mut self)
pub(super) fn convolve( &mut self, i: MatrixBorrowed<'_, D>, c: MatrixBorrowed<'_, D>, f: MatrixBorrowed<'_, D>, )
pub(super) fn mul_tanh( &mut self, o: MatrixBorrowed<'_, D>, c: MatrixBorrowed<'_, D>, )
source§impl<'a> MatrixBorrowedMut<'a, 1>
impl<'a> MatrixBorrowedMut<'a, 1>
sourcepub(super) fn add_dot_2d(
&mut self,
a: MatrixBorrowed<'_, 1>,
b: MatrixZero<'_, 2>,
)
pub(super) fn add_dot_2d( &mut self, a: MatrixBorrowed<'_, 1>, b: MatrixZero<'_, 2>, )
Calculate the dot product of a and b, adding the result to self.
Note: For better dot product efficiency, if b
is MxN, then a
should be N;
this is the opposite of standard practice.
source§impl<'a> MatrixBorrowedMut<'a, 2>
impl<'a> MatrixBorrowedMut<'a, 2>
sourcepub(super) fn add_dot_3d_1(
&mut self,
a: MatrixBorrowed<'_, 1>,
b: MatrixZero<'_, 3>,
)
pub(super) fn add_dot_3d_1( &mut self, a: MatrixBorrowed<'_, 1>, b: MatrixZero<'_, 3>, )
Calculate the dot product of a and b, adding the result to self.
Self should be MxN; a
, O; and b
, MxNxO.
sourcepub(super) fn add_dot_3d_2(
&mut self,
a: MatrixZero<'_, 1>,
b: MatrixZero<'_, 3>,
)
pub(super) fn add_dot_3d_2( &mut self, a: MatrixZero<'_, 1>, b: MatrixZero<'_, 3>, )
Calculate the dot product of a and b, adding the result to self.
Self should be MxN; a
, O; and b
, MxNxO.
Auto Trait Implementations§
impl<'a, const D: usize> Freeze for MatrixBorrowedMut<'a, D>
impl<'a, const D: usize> RefUnwindSafe for MatrixBorrowedMut<'a, D>
impl<'a, const D: usize> Send for MatrixBorrowedMut<'a, D>
impl<'a, const D: usize> Sync for MatrixBorrowedMut<'a, D>
impl<'a, const D: usize> Unpin for MatrixBorrowedMut<'a, D>
impl<'a, const D: usize> !UnwindSafe for MatrixBorrowedMut<'a, D>
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