pub struct Shape(/* private fields */);Implementations§
Source§impl Shape
impl Shape
pub fn from_vec(v: Vec<usize>) -> Shape
pub fn layout(&self) -> &Layout
pub fn layout_mut(&mut self) -> &mut Layout
pub fn from_array<const N: usize>(v: [usize; N]) -> Shape
pub fn from_slice(v: &[usize]) -> Shape
pub fn dims4(&self) -> (usize, usize, usize, usize)
pub fn dims3(&self) -> (usize, usize, usize)
pub fn dims2(&self) -> (usize, usize)
pub fn dims1(&self) -> usize
pub fn elem_count(&self) -> usize
pub fn iter<'a>(&'a self, n: usize) -> ShapeIter<'a>
pub fn select_axis(&self, a: Axis) -> Shape
pub fn size(&self) -> usize
pub fn zero(s: usize) -> Self
pub fn ggml_stride(&self, dtype: GGmlType) -> [usize; 4]
pub fn nd_stride(&self, n_dims: usize) -> [usize; 4]
pub fn dim(&self) -> usize
Trait Implementations§
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more