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

pub struct TensorFact {
    pub datum_type: TypeFact,
    pub shape: ShapeFact,
    pub value: ValueFact,
}

Partial information about a tensor.

The task of the analyser is to tag every edge in the graph with information about the tensors that flow through it - specifically their datum_type, their shape and possibly their value. During the analysis, however, we might only know some of that information (say, for instance, that an edge only carries tensors of rank 4, but without knowing their precise dimension).

This is where tensor facts come in: they hold partial information about the datum_type, shape and value of tensors that might flow through an edge of the graph. The analyser will first tag each edge with a fact, starting with the most general one and specializing it at each iteration. Eventually, it will reach a fixed point that - hopefully - holds enough information.

Fields

datum_type: TypeFactshape: ShapeFactvalue: ValueFact

Methods

impl TensorFact[src]

pub fn new() -> TensorFact[src]

Constructs the most general tensor fact possible.

pub fn any() -> TensorFact[src]

pub fn dt(dt: DatumType) -> TensorFact[src]

pub fn dt_shape<S: Into<ShapeFact>>(dt: DatumType, shape: S) -> TensorFact[src]

pub fn shape<S: Into<ShapeFact>>(shape: S) -> TensorFact[src]

pub fn with_datum_type(self, dt: DatumType) -> TensorFact[src]

pub fn with_shape<S: Into<ShapeFact>>(self, shape: S) -> TensorFact[src]

pub fn with_streaming_shape<S: IntoIterator<Item = Option<usize>>>(
    self,
    shape: S
) -> TensorFact
[src]

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

pub fn format_dt_shape(&self) -> String[src]

Trait Implementations

impl Fact for TensorFact[src]

type Concrete = Arc<Tensor>

fn concretize(&self) -> Option<Self::Concrete>[src]

Tries to transform the fact into a concrete value.

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.

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

Tries to unify the fact with another fact of the same type and update self. Read more

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

Tries to unify the fact with another fact of the same type and update both of them. Read more

fn unify_all(facts: &mut [&mut Self]) -> TractResult<bool>[src]

Tries to unify all facts in the list. Read more

impl TensorInfo for TensorFact[src]

impl Clone for TensorFact[src]

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

Performs copy-assignment from source. Read more

impl Default for TensorFact[src]

impl<V: Into<Arc<Tensor>>> From<V> for TensorFact[src]

impl<'a> From<&'a Tensor> for TensorFact[src]

impl PartialEq<TensorFact> for TensorFact[src]

impl Debug for TensorFact[src]

impl<'a> TryFrom<&'a TensorFact> for TypedTensorInfo[src]

type Error = TractError

The type returned in the event of a conversion error.

impl TryFrom<TensorFact> for TypedTensorInfo[src]

type Error = TractError

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

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]