[−][src]Struct tract_core::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]>,
pub 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,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Downcast for T where
T: Any, [src]
T: Any,
pub fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>[src]
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>[src]
pub fn as_any(&self) -> &(dyn Any + 'static)[src]
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)[src]
impl<T> DowncastSync for T where
T: Send + Sync + Any, [src]
T: Send + Sync + Any,
impl<T> DynClone for T where
T: Clone, [src]
T: Clone,
pub fn __clone_box(&self, Private) -> *mut ()[src]
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.
pub fn to_owned(&self) -> T[src]
pub 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.
pub 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>,