[−][src]Struct math::tensor::TensorShape
The shape of an N-dimensional tensor has a size for each dimension, with an
associated stride, e.g., a row-major 3 x 5 matrix will have a stride of 5
for the dimension of size 3 and a stride of 1 for the dimension of size 5,
and the resulting dims_strides
is [(3, 5), (5, 1)]
. Index 0 of
dims_strides
always refers to the leftmost dimension.
Implementations
impl TensorShape
[src]
pub fn dims(&self) -> Vec<Length>
[src]
pub fn strides(&self) -> Vec<Stride>
[src]
pub fn ndim(&self) -> usize
[src]
pub fn num_elements(&self) -> usize
[src]
Trait Implementations
impl Clone for TensorShape
[src]
fn clone(&self) -> TensorShape
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for TensorShape
[src]
impl Eq for TensorShape
[src]
impl<'_> From<&'_ [isize; 1]> for TensorShape
[src]
impl<'_> From<&'_ [isize; 2]> for TensorShape
[src]
impl<'_> From<&'_ [isize; 3]> for TensorShape
[src]
impl<'_> From<&'_ [isize; 4]> for TensorShape
[src]
impl<'_> From<&'_ [isize; 5]> for TensorShape
[src]
impl<'_> From<&'_ [isize; 6]> for TensorShape
[src]
impl<'_> From<&'_ [isize; 7]> for TensorShape
[src]
impl<'_> From<&'_ [isize; 8]> for TensorShape
[src]
impl<'_> From<&'_ [usize; 1]> for TensorShape
[src]
impl<'_> From<&'_ [usize; 2]> for TensorShape
[src]
impl<'_> From<&'_ [usize; 3]> for TensorShape
[src]
impl<'_> From<&'_ [usize; 4]> for TensorShape
[src]
impl<'_> From<&'_ [usize; 5]> for TensorShape
[src]
impl<'_> From<&'_ [usize; 6]> for TensorShape
[src]
impl<'_> From<&'_ [usize; 7]> for TensorShape
[src]
impl<'_> From<&'_ [usize; 8]> for TensorShape
[src]
impl<'_> From<&'_ Vec<i32>> for TensorShape
[src]
impl<'_> From<&'_ Vec<i64>> for TensorShape
[src]
impl<'_> From<&'_ Vec<isize>> for TensorShape
[src]
impl<'_> From<&'_ Vec<u32>> for TensorShape
[src]
impl<'_> From<&'_ Vec<u64>> for TensorShape
[src]
impl<'_> From<&'_ Vec<usize>> for TensorShape
[src]
impl From<[i32; 1]> for TensorShape
[src]
impl From<[i32; 2]> for TensorShape
[src]
impl From<[i32; 3]> for TensorShape
[src]
impl From<[i32; 4]> for TensorShape
[src]
impl From<[i32; 5]> for TensorShape
[src]
impl From<[i32; 6]> for TensorShape
[src]
impl From<[i32; 7]> for TensorShape
[src]
impl From<[i32; 8]> for TensorShape
[src]
impl From<[i64; 1]> for TensorShape
[src]
impl From<[i64; 2]> for TensorShape
[src]
impl From<[i64; 3]> for TensorShape
[src]
impl From<[i64; 4]> for TensorShape
[src]
impl From<[i64; 5]> for TensorShape
[src]
impl From<[i64; 6]> for TensorShape
[src]
impl From<[i64; 7]> for TensorShape
[src]
impl From<[i64; 8]> for TensorShape
[src]
impl From<[isize; 1]> for TensorShape
[src]
impl From<[isize; 2]> for TensorShape
[src]
impl From<[isize; 3]> for TensorShape
[src]
impl From<[isize; 4]> for TensorShape
[src]
impl From<[isize; 5]> for TensorShape
[src]
impl From<[isize; 6]> for TensorShape
[src]
impl From<[isize; 7]> for TensorShape
[src]
impl From<[isize; 8]> for TensorShape
[src]
impl From<[u32; 1]> for TensorShape
[src]
impl From<[u32; 2]> for TensorShape
[src]
impl From<[u32; 3]> for TensorShape
[src]
impl From<[u32; 4]> for TensorShape
[src]
impl From<[u32; 5]> for TensorShape
[src]
impl From<[u32; 6]> for TensorShape
[src]
impl From<[u32; 7]> for TensorShape
[src]
impl From<[u32; 8]> for TensorShape
[src]
impl From<[u64; 1]> for TensorShape
[src]
impl From<[u64; 2]> for TensorShape
[src]
impl From<[u64; 3]> for TensorShape
[src]
impl From<[u64; 4]> for TensorShape
[src]
impl From<[u64; 5]> for TensorShape
[src]
impl From<[u64; 6]> for TensorShape
[src]
impl From<[u64; 7]> for TensorShape
[src]
impl From<[u64; 8]> for TensorShape
[src]
impl From<[usize; 1]> for TensorShape
[src]
impl From<[usize; 2]> for TensorShape
[src]
impl From<[usize; 3]> for TensorShape
[src]
impl From<[usize; 4]> for TensorShape
[src]
impl From<[usize; 5]> for TensorShape
[src]
impl From<[usize; 6]> for TensorShape
[src]
impl From<[usize; 7]> for TensorShape
[src]
impl From<[usize; 8]> for TensorShape
[src]
impl From<Vec<i32>> for TensorShape
[src]
impl From<Vec<i64>> for TensorShape
[src]
impl From<Vec<isize>> for TensorShape
[src]
impl From<Vec<u32>> for TensorShape
[src]
impl From<Vec<u64>> for TensorShape
[src]
impl From<Vec<usize>> for TensorShape
[src]
impl Ord for TensorShape
[src]
fn cmp(&self, other: &TensorShape) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<TensorShape> for TensorShape
[src]
fn eq(&self, other: &TensorShape) -> bool
[src]
fn ne(&self, other: &TensorShape) -> bool
[src]
impl PartialOrd<TensorShape> for TensorShape
[src]
fn partial_cmp(&self, other: &TensorShape) -> Option<Ordering>
[src]
fn lt(&self, other: &TensorShape) -> bool
[src]
fn le(&self, other: &TensorShape) -> bool
[src]
fn gt(&self, other: &TensorShape) -> bool
[src]
fn ge(&self, other: &TensorShape) -> bool
[src]
impl StructuralEq for TensorShape
[src]
impl StructuralPartialEq for TensorShape
[src]
Auto Trait Implementations
impl RefUnwindSafe for TensorShape
impl Send for TensorShape
impl Sync for TensorShape
impl Unpin for TensorShape
impl UnwindSafe for TensorShape
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,