[][src]Struct tract_hir::prelude::InferenceFact

pub struct InferenceFact {
    pub datum_type: TypeFactoid,
    pub shape: ShapeFactoid,
    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: TypeFactoidshape: ShapeFactoidvalue: ValueFact

Implementations

impl InferenceFact[src]

pub fn new() -> InferenceFact[src]

Constructs the most general tensor fact possible.

pub fn any() -> InferenceFact[src]

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

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

pub fn shape<S: Into<ShapeFactoid>>(shape: S) -> InferenceFact[src]

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

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

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

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

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

pub fn dt_shape_from_tensor(t: &Tensor) -> InferenceFact[src]

pub fn without_value(self) -> InferenceFact[src]

Trait Implementations

impl Clone for InferenceFact[src]

impl Debug for InferenceFact[src]

impl Default for InferenceFact[src]

impl Fact for InferenceFact[src]

impl Factoid for InferenceFact[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.

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

impl<'a> From<&'a InferenceFact> for InferenceFact[src]

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

impl<'a> From<&'a TypedFact> for InferenceFact[src]

impl From<Arc<Tensor>> for InferenceFact[src]

impl From<Tensor> for InferenceFact[src]

impl Hash for InferenceFact[src]

impl ModelSpecialOps<InferenceFact, Box<dyn InferenceOp + 'static>> for InferenceModel[src]

impl ModelWireNode<InferenceFact, Box<dyn InferenceOp + 'static>> for InferenceModel[src]

impl PartialEq<InferenceFact> for InferenceFact[src]

impl StructuralPartialEq for InferenceFact[src]

impl<'a> TryFrom<&'a InferenceFact> for TypedFact[src]

type Error = TractError

The type returned in the event of a conversion error.

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