Trait tract_data::internal::DimLike [−][src]
pub trait DimLike: Clone + Default + PartialEq + From<usize> + for<'a> TryFrom<&'a TDim, Error = Error> + Zero + Debug + Display + Hash + Add<Self, Output = Self> + Add<usize, Output = Self> + for<'a> Add<&'a Self, Output = Self> + Sub<Self, Output = Self> + Sub<usize, Output = Self> + for<'a> Sub<&'a Self, Output = Self> + Mul<usize, Output = Self> + Div<usize, Output = Self> + Rem<usize, Output = Self> + Send + Sync + 'static + Sum + ToDim { fn maybe_div(&self, other: &Self) -> Result<(Self, u64)>; fn maybe_mul(&self, other: &Self) -> Result<Self>; fn to_i64(&self) -> Result<i64>; fn one() -> Self; fn eval(&self, values: &SymbolValues) -> Self; fn div_ceil(&self, other: usize) -> Self { ... } fn to_usize(&self) -> Result<usize> { ... } fn to_isize(&self) -> Result<isize> { ... } fn to_i32(&self) -> Result<i32> { ... } }
A super-trait for value acting as tensor dimensions in tract.
Implemented by:
usizefor regular dimensionsTDimsupporting regular and streaming dimensions
Required methods
fn maybe_div(&self, other: &Self) -> Result<(Self, u64)>[src]
fn maybe_mul(&self, other: &Self) -> Result<Self>[src]
fn to_i64(&self) -> Result<i64>[src]
Convert to regular integer.
fn one() -> Self[src]
do not use num_traits::Mul as it implies a regular Mul
fn eval(&self, values: &SymbolValues) -> Self[src]
Provided methods
fn div_ceil(&self, other: usize) -> Self[src]
Integer divise, rounding up to next integer.