pub struct Shape(/* private fields */);Implementations§
Source§impl Shape
impl Shape
pub fn new(dims: impl Into<Arc<[usize]>>) -> Self
Sourcepub fn size(&self) -> usize
pub fn size(&self) -> usize
Total number of elements implied by this shape. Uses saturating multiplication to avoid overflow in release builds.
pub fn dimensions(&self) -> usize
pub fn contains_dim(&self, dim: usize) -> bool
pub fn dim_at(&self, index: usize) -> usize
pub fn rank(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn is_scalar(&self) -> bool
pub fn is_vector(&self) -> bool
pub fn is_matrix(&self) -> bool
pub fn is_tensor(&self) -> bool
pub fn is_square(&self) -> bool
pub fn iter(&self) -> impl Iterator<Item = &usize>
pub fn as_slice(&self) -> &[usize]
Trait Implementations§
impl Eq for Shape
impl StructuralPartialEq for Shape
Auto Trait Implementations§
impl Freeze for Shape
impl RefUnwindSafe for Shape
impl Send for Shape
impl Sync for Shape
impl Unpin for Shape
impl UnsafeUnpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.