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§
Source§impl<'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]
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§
Source§impl<'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>
Source§fn clone(&self) -> TensorView<'t, T, RANK>
fn clone(&self) -> TensorView<'t, T, RANK>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'t, T> Index<usize> for TensorView<'t, T, 1>
impl<'t, T> Index<usize> for TensorView<'t, T, 1>
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> Freeze for TensorView<'t, T, RANK>
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§
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