pub struct TensorShape {
pub dims_strides: Vec<(Unitless, Unitless)>,
}
Expand description
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.
Fields§
§dims_strides: Vec<(Unitless, Unitless)>
Implementations§
Trait Implementations§
Source§impl Clone for TensorShape
impl Clone for TensorShape
Source§fn clone(&self) -> TensorShape
fn clone(&self) -> TensorShape
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for TensorShape
impl Debug for TensorShape
Source§impl Ord for TensorShape
impl Ord for TensorShape
Source§fn cmp(&self, other: &TensorShape) -> Ordering
fn cmp(&self, other: &TensorShape) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for TensorShape
impl PartialEq for TensorShape
Source§impl PartialOrd for TensorShape
impl PartialOrd for TensorShape
impl Eq for TensorShape
impl StructuralPartialEq for TensorShape
Auto Trait Implementations§
impl Freeze for TensorShape
impl RefUnwindSafe for TensorShape
impl Send for TensorShape
impl Sync for TensorShape
impl Unpin for TensorShape
impl UnwindSafe for TensorShape
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