Struct zenu_matrix::shape_stride::ShapeStride
source · 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 copy 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<D: PartialEq + DimTrait> PartialEq for ShapeStride<D>
impl<D: PartialEq + DimTrait> PartialEq for ShapeStride<D>
source§fn eq(&self, other: &ShapeStride<D>) -> bool
fn eq(&self, other: &ShapeStride<D>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<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