[][src]Struct tract_hir::infer::ShapeFactoid

pub struct ShapeFactoid { /* fields omitted */ }

Partial information about a shape.

A basic example of a shape fact is shapefactoid![1, 2], which corresponds to the shape [1, 2] in Arc. We can use _ in facts to denote unknown dimensions (e.g. shapefactoid![1, 2, _] corresponds to any shape [1, 2, k] with k a non-negative integer). We can also use .. at the end of a fact to only specify its first dimensions, so shapefactoid![1, 2; ..] matches any shape that starts with [1, 2] (e.g. [1, 2, i] or [1, 2, i, j]), while shapefactoid![..] matches any shape.

Implementations

impl ShapeFactoid[src]

pub fn open(dims: TVec<DimFact>) -> ShapeFactoid[src]

Constructs an open shape fact.

pub fn is_open(&self) -> bool[src]

pub fn closed(dims: TVec<DimFact>) -> ShapeFactoid[src]

Constructs a closed shape fact.

pub fn rank(&self) -> IntFactoid[src]

pub fn ensure_rank_at_least(&mut self, n: usize) -> bool[src]

pub fn dim(&self, i: usize) -> Option<DimFact>[src]

pub fn set_dim(&mut self, i: usize, d: TDim) -> bool[src]

pub fn dims(&self) -> impl Iterator<Item = DimFact>[src]

pub fn stream_info(&self) -> TractResult<Option<StreamFact>>[src]

pub fn as_concrete_finite(&self) -> TractResult<Option<TVec<usize>>>[src]

Trait Implementations

impl Clone for ShapeFactoid[src]

impl Debug for ShapeFactoid[src]

impl Default for ShapeFactoid[src]

fn default() -> ShapeFactoid[src]

Returns the most general shape fact possible.

impl Factoid for ShapeFactoid[src]

type Concrete = TVec<TDim>

fn concretize(self: &ShapeFactoid) -> Option<TVec<TDim>>[src]

Tries to transform the fact into a Vec<usize>, or returns None.

fn unify(&self, other: &Self) -> TractResult<Self>[src]

Tries to unify the fact with another fact of the same type.

impl<D: ToDim, I: IntoIterator<Item = D>> From<I> for ShapeFactoid[src]

impl FromIterator<TDim> for ShapeFactoid[src]

fn from_iter<I: IntoIterator<Item = TDim>>(iter: I) -> ShapeFactoid[src]

Converts an iterator over usize into a closed shape.

impl FromIterator<usize> for ShapeFactoid[src]

fn from_iter<I: IntoIterator<Item = usize>>(iter: I) -> ShapeFactoid[src]

Converts an iterator over usize into a closed shape.

impl Hash for ShapeFactoid[src]

impl IntoExp<ShapeFactoid> for ShapeFactoid[src]

impl IntoExp<ShapeFactoid> for ShapeProxy[src]

impl<'a> IntoExp<ShapeFactoid> for &'a ShapeProxy[src]

impl IntoExp<ShapeFactoid> for TVec<TDim>[src]

impl Output for ShapeFactoid[src]

impl PartialEq<ShapeFactoid> for ShapeFactoid[src]

impl StructuralPartialEq for ShapeFactoid[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Downcast for T where
    T: Any

impl<T> DowncastSync for T where
    T: Send + Sync + Any

impl<T> DynClone for T where
    T: Clone
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, E> IntoExp<T> for E where
    E: 'static + TExp<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.