pub struct ShapeStride<D: DimTrait> { /* private fields */ }
Implementations§
Source§impl<D: DimTrait> ShapeStride<D>
impl<D: DimTrait> ShapeStride<D>
pub fn new(shape: D, stride: D) -> Self
pub fn shape(&self) -> D
pub fn stride(&self) -> D
pub fn sort_by_stride(&self) -> Self
pub fn min_stride(&self) -> usize
Sourcepub fn is_contiguous(&self) -> bool
pub fn is_contiguous(&self) -> bool
このShapeStride
が連続しているかどうかを判定する
transposeされていた場合は並び替えを行い、
そのストライドが、default_stride
のn倍になっているかどうかを判定する
Sourcepub fn is_transposed(&self) -> bool
pub fn is_transposed(&self) -> bool
転置は最後の次元と最後から2番目の次元を入れ替えることで表現される
pub fn transpose(&self) -> Self
pub fn is_default_stride(&self) -> bool
Sourcepub fn is_transposed_default_stride(&self) -> bool
pub fn is_transposed_default_stride(&self) -> bool
shpae
stride
が転置されている場合、
転置を元に戻した場合default_stride
になっているかどうかを判定する
Trait Implementations§
Source§impl<D: Clone + DimTrait> Clone for ShapeStride<D>
impl<D: Clone + DimTrait> Clone for ShapeStride<D>
Source§fn clone(&self) -> ShapeStride<D>
fn clone(&self) -> ShapeStride<D>
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 moreimpl<D: Copy + DimTrait> Copy for ShapeStride<D>
impl<D: DimTrait> StructuralPartialEq for ShapeStride<D>
Auto Trait Implementations§
impl<D> Freeze for ShapeStride<D>where
D: Freeze,
impl<D> RefUnwindSafe for ShapeStride<D>where
D: RefUnwindSafe,
impl<D> Send for ShapeStride<D>where
D: Send,
impl<D> Sync for ShapeStride<D>where
D: Sync,
impl<D> Unpin for ShapeStride<D>where
D: Unpin,
impl<D> UnwindSafe for ShapeStride<D>where
D: 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