Trait tract_hir::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 dimensions
  • TDim 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

Loading content...

Provided methods

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

Integer divise, rounding up to next integer.

pub fn to_usize(&self) -> Result<usize, Error>

pub fn to_isize(&self) -> Result<isize, Error>

pub fn to_i32(&self) -> Result<i32, Error>

Loading content...

Implementations on Foreign Types

impl DimLike for usize

Loading content...

Implementors

impl DimLike for TDim

Loading content...