pub struct Shape(/* private fields */);
Expand description
Shape of tensor
Implementations§
Source§impl Shape
impl Shape
Sourcepub fn numel(&self) -> usize
pub fn numel(&self) -> usize
Get number of elements in tensor with this shape (a product of it’s dimensions).
Sourcepub fn iter(
&self,
) -> impl DoubleEndedIterator<Item = &usize> + ExactSizeIterator
pub fn iter( &self, ) -> impl DoubleEndedIterator<Item = &usize> + ExactSizeIterator
Iter
Sourcepub fn iter_mut(
&mut self,
) -> impl DoubleEndedIterator<Item = &mut usize> + ExactSizeIterator
pub fn iter_mut( &mut self, ) -> impl DoubleEndedIterator<Item = &mut usize> + ExactSizeIterator
Iter mut
Sourcepub fn expand_axes(&self, shape: &Shape) -> Axes
pub fn expand_axes(&self, shape: &Shape) -> Axes
Get axes along which self was expanded to shape
Trait Implementations§
Source§impl<'a> IntoIterator for &'a Shape
impl<'a> IntoIterator for &'a Shape
Source§impl<'a> IntoIterator for &'a mut Shape
impl<'a> IntoIterator for &'a mut Shape
Source§impl Ord for Shape
impl Ord for Shape
Source§impl PartialOrd for Shape
impl PartialOrd for Shape
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 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