Struct orkhon::prelude::ops::nn::tract_data::internal::TensorView[]

pub struct TensorView<'a> { /* fields omitted */ }

Implementations

impl<'a> TensorView<'a>

pub unsafe fn from_bytes(
    tensor: &'a Tensor,
    offset_bytes: isize,
    shape: &'a [usize],
    strides: &'a [isize]
) -> TensorView<'a>

pub fn at_prefix(
    tensor: &'a Tensor,
    prefix: &[usize]
) -> Result<TensorView<'a>, Error>

pub unsafe fn at_prefix_unchecked(
    tensor: &'a Tensor,
    prefix: &[usize]
) -> TensorView<'a>

pub fn datum_type(&self) -> DatumType

pub fn shape(&self) -> &[usize]

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]

pub fn strides(&self) -> &[isize]

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]

pub fn len(&self) -> usize

pub fn rank(&self) -> usize

pub fn as_ptr<D>(&self) -> Result<*const D, Error> where
    D: Datum

Access the data as a pointer.

pub unsafe fn as_ptr_unchecked<D>(&self) -> *const D where
    D: Datum

Access the data as a pointer.

pub unsafe fn as_ptr_mut_unchecked<D>(&mut self) -> *mut D where
    D: Datum

Access the data as a pointer.

pub fn as_ptr_mut<D>(&mut self) -> Result<*mut D, Error> where
    D: Datum

Access the data as a mutable pointer.

pub unsafe fn as_slice_unchecked<D>(&self) -> &[D]

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
where
    D: Datum

Access the data as a slice.

pub fn as_slice<D>(&self) -> Result<&[D], Error> where
    D: Datum

Access the data as a slice.

pub unsafe fn as_slice_mut_unchecked<D>(&mut self) -> &mut [D]

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
where
    D: Datum

Access the data as a mutable slice.

pub fn as_slice_mut<D>(&mut self) -> Result<&mut [D], Error> where
    D: Datum

Access the data as a mutable slice.

pub unsafe fn offset_bytes(&mut self, offset: isize)

pub unsafe fn offset_axis_unchecked(&mut self, axis: usize, pos: isize)

pub unsafe fn offset_axis(&mut self, axis: usize, pos: isize)

pub unsafe fn at_unchecked<T>(&self, coords: impl AsRef<[usize]>) -> &T

Notable traits for &'_ mut R

impl<'_, R> Read for &'_ mut R where
    R: Read + ?Sized
impl<'_, W> Write for &'_ mut W where
    W: Write + ?Sized
impl<'_, I> Iterator for &'_ mut I where
    I: Iterator + ?Sized
type Item = <I as Iterator>::Item;impl<'_, F> Future for &'_ mut F where
    F: Unpin + Future + ?Sized
type Output = <F as Future>::Output;
where
    T: Datum

pub unsafe fn at_mut_unchecked<T>(
    &mut self,
    coords: impl AsRef<[usize]>
) -> &mut T

Notable traits for &'_ mut R

impl<'_, R> Read for &'_ mut R where
    R: Read + ?Sized
impl<'_, W> Write for &'_ mut W where
    W: Write + ?Sized
impl<'_, I> Iterator for &'_ mut I where
    I: Iterator + ?Sized
type Item = <I as Iterator>::Item;impl<'_, F> Future for &'_ mut F where
    F: Unpin + Future + ?Sized
type Output = <F as Future>::Output;
where
    T: Datum

pub fn at<T>(&self, coords: impl AsRef<[usize]>) -> Result<&T, Error> where
    T: Datum

pub fn at_mut<T>(
    &mut self,
    coords: impl AsRef<[usize]>
) -> Result<&mut T, Error> where
    T: Datum

Trait Implementations

impl<'a> Clone for TensorView<'a>

impl<'a> Debug for TensorView<'a>

Auto Trait Implementations

impl<'a> RefUnwindSafe for TensorView<'a>[src]

impl<'a> Send for TensorView<'a>[src]

impl<'a> Sync for TensorView<'a>[src]

impl<'a> Unpin for TensorView<'a>[src]

impl<'a> UnwindSafe for TensorView<'a>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Downcast for T where
    T: Any

impl<T> DowncastSync for T where
    T: Send + Sync + Any

impl<T> DynClone for T where
    T: Clone
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.