[][src]Trait tract_data::internal::DimLike

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 {
    pub fn maybe_div(&self, other: &Self) -> Result<(Self, u64)>;
pub fn maybe_mul(&self, other: &Self) -> Result<Self>;
pub fn to_i64(&self) -> Result<i64>;
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> { ... }
pub fn to_isize(&self) -> Result<isize> { ... }
pub fn to_i32(&self) -> Result<i32> { ... } }

A super-trait for value acting as tensor dimensions in tract.

Implemented by:

  • usize for regular dimensions
  • TDim supporting regular and streaming dimensions

Required methods

pub fn maybe_div(&self, other: &Self) -> Result<(Self, u64)>[src]

pub fn maybe_mul(&self, other: &Self) -> Result<Self>[src]

pub fn to_i64(&self) -> Result<i64>[src]

Convert to regular integer.

pub fn one() -> Self[src]

do not use num_traits::Mul as it implies a regular Mul

pub fn eval(&self, values: &SymbolValues) -> Self[src]

Loading content...

Provided methods

pub fn div_ceil(&self, other: usize) -> Self[src]

Integer divise, rounding up to next integer.

pub fn to_usize(&self) -> Result<usize>[src]

pub fn to_isize(&self) -> Result<isize>[src]

pub fn to_i32(&self) -> Result<i32>[src]

Loading content...

Implementations on Foreign Types

impl DimLike for usize[src]

Loading content...

Implementors

impl DimLike for TDim[src]

Loading content...