Struct tract_hir::prelude::InferenceFact [−][src]
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: TypeFactoid
shape: ShapeFactoid
value: 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 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]
fn clone(&self) -> InferenceFact
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for InferenceFact
[src]
impl Default for InferenceFact
[src]
fn default() -> InferenceFact
[src]
impl Fact for InferenceFact
[src]
fn to_typed_fact(&self) -> TractResult<TypedFact>
[src]
fn matches(&self, t: &Tensor) -> TractResult<bool>
[src]
fn same_as(&self, other: &dyn Fact) -> bool
[src]
fn compatible_with(&self, other: &dyn Fact) -> bool
[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.
fn is_concrete(&self) -> bool
[src]
fn unify_with(&mut self, other: &Self) -> TractResult<bool>
[src]
fn unify_with_mut(&mut self, other: &mut Self) -> TractResult<bool>
[src]
fn unify_all(facts: &mut [&mut Self]) -> TractResult<bool>
[src]
impl<'a> From<&'a Arc<Tensor>> for InferenceFact
[src]
fn from(t: &'a Arc<Tensor>) -> InferenceFact
[src]
impl<'a> From<&'a InferenceFact> for InferenceFact
[src]
fn from(t: &'a InferenceFact) -> InferenceFact
[src]
impl<'a> From<&'a Tensor> for InferenceFact
[src]
fn from(t: &'a Tensor) -> InferenceFact
[src]
impl<'a> From<&'a TypedFact> for InferenceFact
[src]
fn from(t: &'a TypedFact) -> InferenceFact
[src]
impl From<Arc<Tensor>> for InferenceFact
[src]
fn from(t: Arc<Tensor>) -> InferenceFact
[src]
impl From<Tensor> for InferenceFact
[src]
fn from(t: Tensor) -> InferenceFact
[src]
impl Hash for InferenceFact
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<InferenceFact> for InferenceFact
[src]
fn eq(&self, other: &InferenceFact) -> bool
[src]
fn ne(&self, other: &InferenceFact) -> bool
[src]
impl SpecialOps<InferenceFact, Box<dyn InferenceOp + 'static, Global>> for InferenceModel
[src]
fn is_source(op: &Box<dyn InferenceOp>) -> bool
[src]
fn create_dummy(&self) -> Box<dyn InferenceOp>ⓘNotable traits for Box<R, Global>
impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
[src]
Notable traits for Box<R, Global>
impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
fn create_source(&self, _fact: InferenceFact) -> Box<dyn InferenceOp>ⓘNotable traits for Box<R, Global>
impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
[src]
Notable traits for Box<R, Global>
impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
fn wire_node(
&mut self,
name: impl Into<String>,
op: impl Into<Box<dyn InferenceOp>>,
inputs: &[OutletId]
) -> TractResult<TVec<OutletId>>
[src]
&mut self,
name: impl Into<String>,
op: impl Into<Box<dyn InferenceOp>>,
inputs: &[OutletId]
) -> TractResult<TVec<OutletId>>
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.
fn try_from(fact: &InferenceFact) -> TractResult<TypedFact>
[src]
Auto Trait Implementations
impl RefUnwindSafe for InferenceFact
impl Send for InferenceFact
impl Sync for InferenceFact
impl Unpin for InferenceFact
impl UnwindSafe for InferenceFact
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow(&self) -> &TⓘNotable traits for &'_ mut R
impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, F> Future for &'_ mut F where
F: Future + Unpin + ?Sized, type Output = <F as Future>::Output;impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
[src]
Notable traits for &'_ mut R
impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, F> Future for &'_ mut F where
F: Future + Unpin + ?Sized, type Output = <F as Future>::Output;impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut TⓘNotable traits for &'_ mut R
impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, F> Future for &'_ mut F where
F: Future + Unpin + ?Sized, type Output = <F as Future>::Output;impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
[src]
Notable traits for &'_ mut R
impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, F> Future for &'_ mut F where
F: Future + Unpin + ?Sized, type Output = <F as Future>::Output;impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
impl<T> Downcast for T where
T: Any,
T: Any,
pub fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>ⓘNotable traits for Box<R, Global>
impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
Notable traits for Box<R, Global>
impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn as_any(&self) -> &(dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
impl<T> DowncastSync for T where
T: Any + Send + Sync,
T: Any + Send + Sync,
impl<T> DynClone for T where
T: Clone,
[src]
T: Clone,
pub fn __clone_box(&self, Private) -> *mut ()
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,