[][src]Trait tract_hir::internal::DimLike

pub trait DimLike: 'static + ToDim + Clone + PartialEq<Self> + From<usize> + for<'a> TryFrom<&'a TDim, Error = TractError> + Default + Send + Sync + Add<Self, Output = Self, Output = Self, Output = 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> + Sum<Self> + Debug + Display + Hash + Zero {
    fn maybe_div(&self, other: &Self) -> Result<(Self, u32), TractError>;
fn maybe_mul(&self, other: &Self) -> Result<Self, TractError>;
fn to_integer(&self) -> Result<i32, TractError>;
fn one() -> Self;
fn concretize_stream_dim(&self, stream_dim: usize) -> 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_div(&self, other: &Self) -> Result<(Self, u32), TractError>

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

fn to_integer(&self) -> Result<i32, TractError>

Convert to regular integer.

fn one() -> Self

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

fn concretize_stream_dim(&self, stream_dim: usize) -> Self

Give streaming dimension its value

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...