Struct math::tensor::tensor_shape::TensorShape
source · 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§fn eq(&self, other: &TensorShape) -> bool
fn eq(&self, other: &TensorShape) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for TensorShape
impl PartialOrd for TensorShape
source§fn partial_cmp(&self, other: &TensorShape) -> Option<Ordering>
fn partial_cmp(&self, other: &TensorShape) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for TensorShape
impl StructuralEq for TensorShape
impl StructuralPartialEq for TensorShape
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§
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