pub struct Strides(/* private fields */);Expand description
Memory strides for each dimension.
Implementations§
Source§impl Strides
impl Strides
Sourcepub fn new(strides: impl IntoIterator<Item = i64>) -> Self
pub fn new(strides: impl IntoIterator<Item = i64>) -> Self
Creates new strides.
Sourcepub fn contiguous(shape: &Shape, elem_size: usize) -> Option<Self>
pub fn contiguous(shape: &Shape, elem_size: usize) -> Option<Self>
Computes contiguous (row-major) strides for a shape.
Sourcepub fn is_contiguous(&self, shape: &Shape, elem_size: usize) -> bool
pub fn is_contiguous(&self, shape: &Shape, elem_size: usize) -> bool
Returns true if these strides represent contiguous memory.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Strides
impl<'de> Deserialize<'de> for Strides
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Strides
impl StructuralPartialEq for Strides
Auto Trait Implementations§
impl Freeze for Strides
impl RefUnwindSafe for Strides
impl Send for Strides
impl Sync for Strides
impl Unpin for Strides
impl UnsafeUnpin for Strides
impl UnwindSafe for Strides
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