[][src]Struct tract_tensorflow::prelude::InferenceFact

pub struct InferenceFact {
    pub datum_type: GenericFactoid<DatumType>,
    pub shape: ShapeFactoid,
    pub value: GenericFactoid<Arc<Tensor>>,
}

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: GenericFactoid<DatumType>shape: ShapeFactoidvalue: GenericFactoid<Arc<Tensor>>

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>(dt: DatumType, shape: S) -> InferenceFact where
    S: Into<ShapeFactoid>, 
[src]

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

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

pub fn with_shape<S>(self, shape: S) -> InferenceFact where
    S: Into<ShapeFactoid>, 
[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>

pub fn concretize(&self) -> Option<<InferenceFact as Factoid>::Concrete>[src]

Tries to transform the fact into a concrete value.

pub fn unify(&self, other: &InferenceFact) -> Result<InferenceFact, Error>[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 PartialEq<InferenceFact> for InferenceFact[src]

impl SpecialOps<InferenceFact, Box<dyn InferenceOp + 'static>> for Graph<InferenceFact, Box<dyn InferenceOp + 'static>>[src]

impl StructuralPartialEq for InferenceFact[src]

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

type Error = Error

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.