[][src]Struct tract_core::analyser::types::ShapeFact

pub struct ShapeFact { /* fields omitted */ }

Partial information about a shape.

A basic example of a shape fact is shapefact![1, 2], which corresponds to the shape [1, 2] in Arc. We can use _ in facts to denote unknown dimensions (e.g. shapefact![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 shapefact![1, 2; ..] matches any shape that starts with [1, 2] (e.g. [1, 2, i] or [1, 2, i, j]), while shapefact![..] matches any shape.

Methods

impl ShapeFact[src]

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

Constructs an open shape fact.

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

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

Constructs a closed shape fact.

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

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

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

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

Trait Implementations

impl Fact for ShapeFact[src]

type Concrete = TVec<TDim>

fn concretize(self: &ShapeFact) -> 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.

fn is_concrete(&self) -> bool[src]

Returns whether the value is fully determined.

impl Output for ShapeFact[src]

fn wrap(self) -> Wrapped[src]

Wraps self in the Wrapped type.

impl IntoExp<ShapeFact> for ShapeFact[src]

impl IntoExp<ShapeFact> for ShapeProxy[src]

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

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

impl PartialEq<ShapeFact> for ShapeFact[src]

impl Default for ShapeFact[src]

fn default() -> ShapeFact[src]

Returns the most general shape fact possible.

impl Clone for ShapeFact[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

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

impl Debug for ShapeFact[src]

impl FromIterator<TDim> for ShapeFact[src]

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

Converts an iterator over usize into a closed shape.

impl FromIterator<usize> for ShapeFact[src]

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

Converts an iterator over usize into a closed shape.

Auto Trait Implementations

impl Send for ShapeFact

impl Sync for ShapeFact

Blanket Implementations

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> From<T> for T[src]

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

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.

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

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

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

impl<T> Downcast for T where
    T: Any
[src]

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