pub struct StackShape<const N: usize> {
pub dims: [usize; N],
pub ndim: usize,
}Expand description
Small shape stored on stack for zero-allocation operations
Fields§
§dims: [usize; N]Dimensions stored on stack
ndim: usizeActual number of used dimensions (may be less than N)
Implementations§
Source§impl<const N: usize> StackShape<N>
impl<const N: usize> StackShape<N>
Sourcepub fn from_slice(dims: &[usize]) -> Option<Self>
pub fn from_slice(dims: &[usize]) -> Option<Self>
Create from slice with runtime length check
Sourcepub fn broadcast_compatible<const M: usize>(
&self,
other: &StackShape<M>,
) -> bool
pub fn broadcast_compatible<const M: usize>( &self, other: &StackShape<M>, ) -> bool
Broadcast compatibility check (no allocation)
Trait Implementations§
Source§impl<const N: usize> Clone for StackShape<N>
impl<const N: usize> Clone for StackShape<N>
Source§fn clone(&self) -> StackShape<N>
fn clone(&self) -> StackShape<N>
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<const N: usize> Debug for StackShape<N>
impl<const N: usize> Debug for StackShape<N>
Source§impl<const N: usize> PartialEq for StackShape<N>
impl<const N: usize> PartialEq for StackShape<N>
impl<const N: usize> Copy for StackShape<N>
impl<const N: usize> Eq for StackShape<N>
impl<const N: usize> StructuralPartialEq for StackShape<N>
Auto Trait Implementations§
impl<const N: usize> Freeze for StackShape<N>
impl<const N: usize> RefUnwindSafe for StackShape<N>
impl<const N: usize> Send for StackShape<N>
impl<const N: usize> Sync for StackShape<N>
impl<const N: usize> Unpin for StackShape<N>
impl<const N: usize> UnsafeUnpin for StackShape<N>
impl<const N: usize> UnwindSafe for StackShape<N>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more