Enum tract_pulse::internal::tract_core::ops::nn::TDim
[−]pub enum TDim {
Sym(Symbol),
Val(i64),
Add(Vec<TDim, Global>),
Mul(Vec<TDim, Global>),
MulInt(i64, Box<TDim, Global>),
Div(Box<TDim, Global>, u64),
}Variants
Sym(Symbol)
Val(i64)
Add(Vec<TDim, Global>)
Mul(Vec<TDim, Global>)
MulInt(i64, Box<TDim, Global>)
Div(Box<TDim, Global>, u64)
Implementations
impl TDim
impl TDim
pub fn is_one(&self) -> bool
pub fn to_i64(&self) -> Result<i64, Error>
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, RandomState>
pub 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
impl<'a> AddAssign<&'a TDim> for TDim
impl<'a> AddAssign<&'a TDim> for TDim
fn add_assign(&mut self, rhs: &'a TDim)
fn add_assign(&mut self, rhs: &'a TDim)
Performs the += operation. Read more
impl<I> AddAssign<I> for TDim where
I: Into<TDim>,
impl<I> AddAssign<I> for TDim where
I: Into<TDim>,
fn add_assign(&mut self, rhs: I)
fn add_assign(&mut self, rhs: I)
Performs the += operation. Read more
impl CoerceFrom<Value> for TDim
impl CoerceFrom<Value> for TDim
fn coerce(builder: &mut ModelBuilder<'_>, from: &Value) -> Result<TDim, Error>
impl DimLike for TDim
impl DimLike for TDim
impl<I> Div<I> for TDim where
I: AsPrimitive<u64> + PrimInt,
impl<I> Div<I> for TDim where
I: AsPrimitive<u64> + PrimInt,
impl<I> DivAssign<I> for TDim where
I: AsPrimitive<u64> + PrimInt,
impl<I> DivAssign<I> for TDim where
I: AsPrimitive<u64> + PrimInt,
fn div_assign(&mut self, rhs: I)
fn div_assign(&mut self, rhs: I)
Performs the /= operation. Read more
impl<'a> MulAssign<&'a TDim> for TDim
impl<'a> MulAssign<&'a TDim> for TDim
fn mul_assign(&mut self, rhs: &'a TDim)
fn mul_assign(&mut self, rhs: &'a TDim)
Performs the *= operation. Read more
impl<I> MulAssign<I> for TDim where
I: Into<TDim>,
impl<I> MulAssign<I> for TDim where
I: Into<TDim>,
fn mul_assign(&mut self, rhs: I)
fn mul_assign(&mut self, rhs: I)
Performs the *= operation. Read more
impl 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) -> Self where
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
impl PartialOrd<TDim> for TDim
impl PartialOrd<TDim> for TDim
fn 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
impl<I> Rem<I> for TDim where
I: AsPrimitive<u64> + PrimInt,
impl<I> Rem<I> for TDim where
I: AsPrimitive<u64> + PrimInt,
impl<I> RemAssign<I> for TDim where
I: AsPrimitive<u64> + PrimInt,
impl<I> RemAssign<I> for TDim where
I: AsPrimitive<u64> + PrimInt,
fn rem_assign(&mut self, rhs: I)
fn rem_assign(&mut self, rhs: I)
Performs the %= operation. Read more
impl<'a> SubAssign<&'a TDim> for TDim
impl<'a> SubAssign<&'a TDim> for TDim
fn sub_assign(&mut self, rhs: &'a TDim)
fn sub_assign(&mut self, rhs: &'a TDim)
Performs the -= operation. Read more
impl<I> SubAssign<I> for TDim where
I: Into<TDim>,
impl<I> SubAssign<I> for TDim where
I: Into<TDim>,
fn 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 T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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
sourceimpl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
sourcefn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>ⓘNotable traits for Box<R, Global>impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>ⓘNotable traits for Box<R, Global>impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
R: Read + ?Sized, impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read more
sourcefn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more
sourcefn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s. Read more
sourcefn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s. Read more