Struct candle_core::shape::Shape
source · pub struct Shape(_);Implementations§
source§impl Shape
impl Shape
pub fn from_dims(dims: &[usize]) -> Self
pub fn rank(&self) -> usize
pub fn into_dims(self) -> Vec<usize>
pub fn dims(&self) -> &[usize]
pub fn elem_count(&self) -> usize
sourcepub fn is_contiguous(&self, stride: &[usize]) -> bool
pub fn is_contiguous(&self, stride: &[usize]) -> bool
Returns true if the strides are C contiguous (aka row major).
sourcepub fn is_fortran_contiguous(&self, stride: &[usize]) -> bool
pub fn is_fortran_contiguous(&self, stride: &[usize]) -> bool
Returns true if the strides are Fortran contiguous (aka column major).
pub fn extend(self, additional_dims: &[usize]) -> Self
Trait Implementations§
source§impl PartialEq<Shape> for Shape
impl PartialEq<Shape> for Shape
impl Eq for Shape
impl StructuralEq for Shape
impl StructuralPartialEq for Shape
Auto Trait Implementations§
impl RefUnwindSafe for Shape
impl Send for Shape
impl Sync for Shape
impl Unpin for Shape
impl UnwindSafe for Shape
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