Enum tract_data::internal::TDim
source · [−]pub enum TDim {
Sym(Symbol),
Val(i64),
Add(Vec<TDim>),
Mul(Vec<TDim>),
MulInt(i64, Box<TDim>),
Div(Box<TDim>, u64),
}Variants
Sym(Symbol)
Val(i64)
Add(Vec<TDim>)
Mul(Vec<TDim>)
MulInt(i64, Box<TDim>)
Div(Box<TDim>, u64)
Implementations
sourceimpl 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
sourceimpl<'a> AddAssign<&'a TDim> for TDim
impl<'a> AddAssign<&'a TDim> for TDim
sourcefn add_assign(&mut self, rhs: &'a TDim)
fn add_assign(&mut self, rhs: &'a TDim)
Performs the += operation. Read more
sourceimpl<I> AddAssign<I> for TDimwhere
I: Into<TDim>,
impl<I> AddAssign<I> for TDimwhere
I: Into<TDim>,
sourcefn add_assign(&mut self, rhs: I)
fn add_assign(&mut self, rhs: I)
Performs the += operation. Read more
sourceimpl DimLike for TDim
impl DimLike for TDim
fn maybe_div(&self, other: &Self) -> TractResult<(Self, u64)>
sourcefn 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>
sourceimpl<I: AsPrimitive<u64> + PrimInt> DivAssign<I> for TDim
impl<I: AsPrimitive<u64> + PrimInt> DivAssign<I> for TDim
sourcefn div_assign(&mut self, rhs: I)
fn div_assign(&mut self, rhs: I)
Performs the /= operation. Read more
sourceimpl<'a> MulAssign<&'a TDim> for TDim
impl<'a> MulAssign<&'a TDim> for TDim
sourcefn mul_assign(&mut self, rhs: &'a TDim)
fn mul_assign(&mut self, rhs: &'a TDim)
Performs the *= operation. Read more
sourceimpl<I: Into<TDim>> MulAssign<I> for TDim
impl<I: Into<TDim>> MulAssign<I> for TDim
sourcefn mul_assign(&mut self, rhs: I)
fn mul_assign(&mut self, rhs: I)
Performs the *= operation. Read more
sourceimpl Ord for TDim
impl Ord for TDim
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialEq<TDim> for TDim
impl PartialEq<TDim> for TDim
sourceimpl PartialOrd<TDim> for TDim
impl PartialOrd<TDim> for TDim
sourcefn partial_cmp(&self, other: &TDim) -> Option<Ordering>
fn partial_cmp(&self, other: &TDim) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl<I: AsPrimitive<u64> + PrimInt> RemAssign<I> for TDim
impl<I: AsPrimitive<u64> + PrimInt> RemAssign<I> for TDim
sourcefn rem_assign(&mut self, rhs: I)
fn rem_assign(&mut self, rhs: I)
Performs the %= operation. Read more
sourceimpl<'a> SubAssign<&'a TDim> for TDim
impl<'a> SubAssign<&'a TDim> for TDim
sourcefn sub_assign(&mut self, rhs: &'a TDim)
fn sub_assign(&mut self, rhs: &'a TDim)
Performs the -= operation. Read more
sourceimpl<I> SubAssign<I> for TDimwhere
I: Into<TDim>,
impl<I> SubAssign<I> for TDimwhere
I: Into<TDim>,
sourcefn sub_assign(&mut self, rhs: I)
fn sub_assign(&mut self, rhs: I)
Performs the -= operation. Read more
impl Eq for TDim
impl StructuralEq for TDim
impl StructuralPartialEq for TDim
Auto Trait Implementations
impl RefUnwindSafe for TDim
impl Send for TDim
impl Sync for TDim
impl Unpin for TDim
impl UnwindSafe for TDim
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more