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> MatrixBorrowedMut<'a, 1>

source

pub(super) fn dim(&self) -> usize

source§

impl<'a> MatrixBorrowedMut<'a, 2>

source

pub(super) fn dim(&self) -> (usize, usize)

source§

impl<'a> MatrixBorrowedMut<'a, 3>

source

pub(super) fn dim(&self) -> (usize, usize, usize)

source§

impl<'a, const D: usize> MatrixBorrowedMut<'a, D>

source

pub(super) fn as_borrowed(&self) -> MatrixBorrowed<'_, D>

source

pub(super) fn as_mut_slice(&mut self) -> &mut [f32]

source

pub(super) fn copy_submatrix<const M: usize>(&mut self, from: usize, to: usize)

source

pub(super) fn add(&mut self, other: MatrixZero<'_, D>) -> Option<()>

source

pub(super) fn softmax_transform(&mut self)

Mutates this matrix by applying a softmax transformation.

source

pub(super) fn sigmoid_transform(&mut self)

source

pub(super) fn tanh_transform(&mut self)

source

pub(super) fn convolve( &mut self, i: MatrixBorrowed<'_, D>, c: MatrixBorrowed<'_, D>, f: MatrixBorrowed<'_, D>, )

source

pub(super) fn mul_tanh( &mut self, o: MatrixBorrowed<'_, D>, c: MatrixBorrowed<'_, D>, )

source§

impl<'a> MatrixBorrowedMut<'a, 1>

source

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>

source

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.

source

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> ErasedDestructor for T
where T: 'static,

source§

impl<T> MaybeSendSync for T