Enum tract_data::prelude::TDim
source · pub enum TDim {
Sym(Symbol),
Val(i64),
Add(Vec<TDim>),
Mul(Vec<TDim>),
MulInt(i64, Box<TDim>),
Div(Box<TDim>, u64),
}Variants§
Implementations§
source§impl TDim
impl TDim
pub fn is_one(&self) -> bool
pub fn to_i64(&self) -> Result<i64>
pub fn eval(&self, values: &SymbolValues) -> TDim
pub fn reduce(self) -> TDim
pub fn simplify(self) -> TDim
pub fn div_ceil(self, rhs: u64) -> TDim
pub fn slope(&self, sym: &Symbol) -> (i64, u64)
pub fn symbols(&self) -> HashSet<Symbol>
sourcepub fn compatible_with(&self, _other: &TDim) -> bool
pub fn compatible_with(&self, _other: &TDim) -> bool
Check if a dim is ‘compatible with’ another, meaning that the current dim is a “sub” dimension within or equal to the _other dim
Trait Implementations§
source§impl<'a> AddAssign<&'a TDim> for TDim
impl<'a> AddAssign<&'a TDim> for TDim
source§fn add_assign(&mut self, rhs: &'a TDim)
fn add_assign(&mut self, rhs: &'a TDim)
Performs the
+= operation. Read moresource§impl<I> AddAssign<I> for TDimwhere
I: Into<TDim>,
impl<I> AddAssign<I> for TDimwhere I: Into<TDim>,
source§fn add_assign(&mut self, rhs: I)
fn add_assign(&mut self, rhs: I)
Performs the
+= operation. Read moresource§impl DimLike for TDim
impl DimLike for TDim
fn maybe_div(&self, other: &Self) -> TractResult<(Self, u64)>
source§fn to_i64(&self) -> TractResult<i64>
fn to_i64(&self) -> TractResult<i64>
Convert to regular integer.
fn eval(&self, values: &SymbolValues) -> Self
fn to_usize(&self) -> TractResult<usize>
fn to_isize(&self) -> TractResult<isize>
fn to_i32(&self) -> TractResult<i32>
source§impl<I: AsPrimitive<u64> + PrimInt> DivAssign<I> for TDim
impl<I: AsPrimitive<u64> + PrimInt> DivAssign<I> for TDim
source§fn div_assign(&mut self, rhs: I)
fn div_assign(&mut self, rhs: I)
Performs the
/= operation. Read moresource§impl<'a> MulAssign<&'a TDim> for TDim
impl<'a> MulAssign<&'a TDim> for TDim
source§fn mul_assign(&mut self, rhs: &'a TDim)
fn mul_assign(&mut self, rhs: &'a TDim)
Performs the
*= operation. Read moresource§impl<I: Into<TDim>> MulAssign<I> for TDim
impl<I: Into<TDim>> MulAssign<I> for TDim
source§fn mul_assign(&mut self, rhs: I)
fn mul_assign(&mut self, rhs: I)
Performs the
*= operation. Read moresource§impl Ord for TDim
impl Ord for TDim
source§impl PartialEq<TDim> for TDim
impl PartialEq<TDim> for TDim
source§impl PartialOrd<TDim> for TDim
impl PartialOrd<TDim> for TDim
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 moresource§impl<I: AsPrimitive<u64> + PrimInt> RemAssign<I> for TDim
impl<I: AsPrimitive<u64> + PrimInt> RemAssign<I> for TDim
source§fn rem_assign(&mut self, rhs: I)
fn rem_assign(&mut self, rhs: I)
Performs the
%= operation. Read moresource§impl<'a> SubAssign<&'a TDim> for TDim
impl<'a> SubAssign<&'a TDim> for TDim
source§fn sub_assign(&mut self, rhs: &'a TDim)
fn sub_assign(&mut self, rhs: &'a TDim)
Performs the
-= operation. Read moresource§impl<I> SubAssign<I> for TDimwhere
I: Into<TDim>,
impl<I> SubAssign<I> for TDimwhere I: Into<TDim>,
source§fn sub_assign(&mut self, rhs: I)
fn sub_assign(&mut self, rhs: I)
Performs the
-= operation. Read more