Trait tract_data::internal::DimLike
source · pub trait DimLike: Clone + Default + PartialEq + From<usize> + for<'a> TryFrom<&'a TDim, Error = TractError> + 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<Self, Output = Self> + Mul<usize, Output = Self> + for<'a> Mul<&'a Self, Output = Self> + Div<usize, Output = Self> + Rem<usize, Output = Self> + Send + Sync + 'static + Sum + Product + ToDim {
// Required methods
fn maybe_div(&self, other: &Self) -> TractResult<(Self, u64)>;
fn to_i64(&self) -> TractResult<i64>;
fn one() -> Self;
fn eval(&self, values: &SymbolValues) -> Self;
fn substitute(&self, from: &Symbol, to: &Self) -> Self;
// Provided methods
fn divceil(&self, other: usize) -> Self { ... }
fn to_usize(&self) -> TractResult<usize> { ... }
fn to_isize(&self) -> TractResult<isize> { ... }
fn to_i32(&self) -> TractResult<i32> { ... }
}
Expand description
A super-trait for value acting as tensor dimensions in tract.
Implemented by:
usize
for regular dimensionsTDim
supporting regular and streaming dimensions
Required Methods§
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 substitute(&self, from: &Symbol, to: &Self) -> Self
Provided Methods§
fn to_usize(&self) -> TractResult<usize>
fn to_isize(&self) -> TractResult<isize>
fn to_i32(&self) -> TractResult<i32>
Object Safety§
This trait is not object safe.