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