Struct hotg_rune_core::TensorView
source · [−]pub struct TensorView<'t, T, const RANK: usize> { /* private fields */ }
Expand description
An immutable view into a Tensor
with a particular rank (number of
dimensions).
Implementations
sourceimpl<'t, T, const RANK: usize> TensorView<'t, T, RANK>
impl<'t, T, const RANK: usize> TensorView<'t, T, RANK>
pub fn elements(&self) -> &'t [T]ⓘNotable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
pub fn dimensions(&self) -> [usize; RANK]
pub fn get(&self, indices: [usize; RANK]) -> Option<&T>
sourcepub fn slice<const NEW_RANK: usize>(
&self,
leading_indices: &[usize]
) -> Option<TensorView<'_, T, NEW_RANK>>
pub fn slice<const NEW_RANK: usize>(
&self,
leading_indices: &[usize]
) -> Option<TensorView<'_, T, NEW_RANK>>
The TensorView
version of Tensor::slice()
.
Trait Implementations
sourceimpl<'t, T: Clone, const RANK: usize> Clone for TensorView<'t, T, RANK>
impl<'t, T: Clone, const RANK: usize> Clone for TensorView<'t, T, RANK>
sourcefn clone(&self) -> TensorView<'t, T, RANK>
fn clone(&self) -> TensorView<'t, T, RANK>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<'t, T: Debug, const RANK: usize> Debug for TensorView<'t, T, RANK>
impl<'t, T: Debug, const RANK: usize> Debug for TensorView<'t, T, RANK>
sourceimpl<'t, T> Index<usize> for TensorView<'t, T, 1>
impl<'t, T> Index<usize> for TensorView<'t, T, 1>
sourceimpl<'t, T: PartialEq, const RANK: usize> PartialEq<TensorView<'t, T, RANK>> for TensorView<'t, T, RANK>
impl<'t, T: PartialEq, const RANK: usize> PartialEq<TensorView<'t, T, RANK>> for TensorView<'t, T, RANK>
sourcefn eq(&self, other: &TensorView<'t, T, RANK>) -> bool
fn eq(&self, other: &TensorView<'t, T, RANK>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &TensorView<'t, T, RANK>) -> bool
fn ne(&self, other: &TensorView<'t, T, RANK>) -> bool
This method tests for !=
.
impl<'t, T: Copy, const RANK: usize> Copy for TensorView<'t, T, RANK>
impl<'t, T, const RANK: usize> StructuralPartialEq for TensorView<'t, T, RANK>
Auto Trait Implementations
impl<'t, T, const RANK: usize> RefUnwindSafe for TensorView<'t, T, RANK> where
T: RefUnwindSafe,
impl<'t, T, const RANK: usize> Send for TensorView<'t, T, RANK> where
T: Sync,
impl<'t, T, const RANK: usize> Sync for TensorView<'t, T, RANK> where
T: Sync,
impl<'t, T, const RANK: usize> Unpin for TensorView<'t, T, RANK>
impl<'t, T, const RANK: usize> UnwindSafe for TensorView<'t, T, RANK> where
T: RefUnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more