[−][src]Struct tract_hir::internal::tract_ndarray::SliceInfo
Represents all of the necessary information to perform a slice.
The type T
is typically [SliceOrIndex; n]
, [SliceOrIndex]
, or
Vec<SliceOrIndex>
. The type D
is the output dimension after calling
.slice()
.
Implementations
impl<T, D> SliceInfo<T, D> where
D: Dimension,
T: AsRef<[SliceOrIndex]>,
[src]
D: Dimension,
T: AsRef<[SliceOrIndex]>,
pub fn new(indices: T) -> Result<SliceInfo<T, D>, ShapeError>
[src]
Returns a new SliceInfo
instance.
Errors if D
is not consistent with indices
.
impl<T, D> SliceInfo<T, D> where
D: Dimension,
T: AsRef<[SliceOrIndex]> + ?Sized,
[src]
D: Dimension,
T: AsRef<[SliceOrIndex]> + ?Sized,
pub fn out_ndim(&self) -> usize
[src]
Returns the number of dimensions after calling
.slice()
(including taking
subviews).
If D
is a fixed-size dimension type, then this is equivalent to
D::NDIM.unwrap()
. Otherwise, the value is calculated by iterating
over the ranges/indices.
Trait Implementations
impl<T, D> AsRef<[SliceOrIndex]> for SliceInfo<T, D> where
D: Dimension,
T: AsRef<[SliceOrIndex]>,
[src]
D: Dimension,
T: AsRef<[SliceOrIndex]>,
fn as_ref(&self) -> &[SliceOrIndex]ⓘ
[src]
impl<T, D> AsRef<SliceInfo<[SliceOrIndex], D>> for SliceInfo<T, D> where
D: Dimension,
T: AsRef<[SliceOrIndex]>,
[src]
D: Dimension,
T: AsRef<[SliceOrIndex]>,
impl<T, D> Clone for SliceInfo<T, D> where
D: Dimension,
T: Clone,
[src]
D: Dimension,
T: Clone,
impl<T, D> Copy for SliceInfo<T, D> where
D: Dimension,
T: Copy,
[src]
D: Dimension,
T: Copy,
impl<T, D> Debug for SliceInfo<T, D> where
D: Dimension + Debug,
T: Debug + ?Sized,
[src]
D: Dimension + Debug,
T: Debug + ?Sized,
impl<T, D> Deref for SliceInfo<T, D> where
D: Dimension,
T: ?Sized,
[src]
D: Dimension,
T: ?Sized,
Auto Trait Implementations
impl<T: ?Sized, D> RefUnwindSafe for SliceInfo<T, D> where
D: RefUnwindSafe,
T: RefUnwindSafe,
D: RefUnwindSafe,
T: RefUnwindSafe,
impl<T: ?Sized, D> Send for SliceInfo<T, D> where
T: Send,
T: Send,
impl<T: ?Sized, D> Sync for SliceInfo<T, D> where
T: Sync,
T: Sync,
impl<T: ?Sized, D> Unpin for SliceInfo<T, D> where
D: Unpin,
T: Unpin,
D: Unpin,
T: Unpin,
impl<T: ?Sized, D> UnwindSafe for SliceInfo<T, D> where
D: UnwindSafe,
T: UnwindSafe,
D: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow(&self) -> &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<'_, F> Future for &'_ mut F where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
[src]
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<'_, F> Future for &'_ mut F where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &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<'_, F> Future for &'_ mut F where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
[src]
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<'_, F> Future for &'_ mut F where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
impl<T> Downcast for T where
T: Any,
T: Any,
fn into_any(self: Box<T>) -> Box<dyn Any + 'static>ⓘNotable traits for Box<R>
impl<R> Read for Box<R> where
R: Read + ?Sized, impl<W> Write for Box<W> where
W: Write + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
Notable traits for Box<R>
impl<R> Read for Box<R> where
R: Read + ?Sized, impl<W> Write for Box<W> where
W: Write + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn as_any(&self) -> &(dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
impl<T> DowncastSync for T where
T: Send + Sync + Any,
T: Send + Sync + Any,
impl<T> DynClone for T where
T: Clone,
[src]
T: Clone,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,