[][src]Trait tract_core::dim::DimLike

pub trait DimLike: Clone + Default + PartialEq + From<usize> + 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_mul(&self, other: &Self) -> TractResult<Self>;
fn to_integer(&self) -> TractResult<i32>;
fn one() -> Self; fn div_ceil(&self, other: usize) -> Self { ... } }

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

fn maybe_mul(&self, other: &Self) -> TractResult<Self>

fn to_integer(&self) -> TractResult<i32>

Convert to regular integer.

fn one() -> Self

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

Loading content...

Provided methods

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

Integer divise, rounding up to next integer.

Loading content...

Implementations on Foreign Types

impl DimLike for usize[src]

Loading content...

Implementors

impl DimLike for TDim[src]

Loading content...