pub struct TensorRef<'a, Shape: TensorShape>(/* private fields */);Implementations§
Source§impl<'a, Shape> TensorRef<'a, Shape>where
Shape: TensorShape,
impl<'a, Shape> TensorRef<'a, Shape>where
Shape: TensorShape,
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn rank(&self) -> usize
pub fn as_slice(&self) -> &[Float] ⓘ
pub fn at(&self, index: [usize; Shape::RANK]) -> &Float
pub fn sum(&self) -> Float
pub fn mean(&self) -> Float
pub fn reshape<NewShape>(self) -> TensorRef<'a, NewShape>where
NewShape: TensorShape,
(): ReshapePreservesElementCount<{ Shape::SIZE }, { NewShape::SIZE }>,
Trait Implementations§
Source§impl<'a, Shape> Clone for TensorRef<'a, Shape>where
Shape: TensorShape,
impl<'a, Shape> Clone for TensorRef<'a, Shape>where
Shape: TensorShape,
Source§impl<'a, Shape> Debug for TensorRef<'a, Shape>where
Shape: TensorShape,
impl<'a, Shape> Debug for TensorRef<'a, Shape>where
Shape: TensorShape,
impl<'a, Shape> Copy for TensorRef<'a, Shape>where
Shape: TensorShape,
Auto Trait Implementations§
impl<'a, Shape> Freeze for TensorRef<'a, Shape>
impl<'a, Shape> RefUnwindSafe for TensorRef<'a, Shape>where
Shape: RefUnwindSafe,
impl<'a, Shape> Send for TensorRef<'a, Shape>where
Shape: Send,
impl<'a, Shape> Sync for TensorRef<'a, Shape>where
Shape: Sync,
impl<'a, Shape> Unpin for TensorRef<'a, Shape>where
Shape: Unpin,
impl<'a, Shape> UnsafeUnpin for TensorRef<'a, Shape>
impl<'a, Shape> UnwindSafe for TensorRef<'a, Shape>where
Shape: UnwindSafe,
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