[−][src]Struct tract_tensorflow::prelude::InferenceFact
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: ShapeFactoid
value: 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]
S: Into<ShapeFactoid>,
pub fn shape<S>(shape: S) -> InferenceFact where
S: Into<ShapeFactoid>,
[src]
S: Into<ShapeFactoid>,
pub fn with_datum_type(self, dt: DatumType) -> InferenceFact
[src]
pub fn with_shape<S>(self, shape: S) -> InferenceFact where
S: Into<ShapeFactoid>,
[src]
S: Into<ShapeFactoid>,
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]
pub 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]
pub fn default() -> InferenceFact
[src]
impl Fact for InferenceFact
[src]
pub fn to_typed_fact(&self) -> Result<TypedFact, Error>
[src]
pub fn matches(&self, t: &Tensor) -> Result<bool, Error>
[src]
pub fn same_as(&self, other: &(dyn Fact + 'static)) -> bool
[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.
pub fn is_concrete(&self) -> bool
[src]
pub fn unify_with(&mut self, other: &Self) -> Result<bool, Error>
[src]
pub fn unify_with_mut(&mut self, other: &mut Self) -> Result<bool, Error>
[src]
pub fn unify_all(facts: &mut [&mut Self]) -> Result<bool, Error>
[src]
impl<'a> From<&'a Arc<Tensor>> for InferenceFact
[src]
pub fn from(t: &'a Arc<Tensor>) -> InferenceFact
[src]
impl<'a> From<&'a InferenceFact> for InferenceFact
[src]
pub fn from(t: &'a InferenceFact) -> InferenceFact
[src]
impl<'a> From<&'a Tensor> for InferenceFact
[src]
pub fn from(t: &'a Tensor) -> InferenceFact
[src]
impl<'a> From<&'a TypedFact> for InferenceFact
[src]
pub fn from(t: &'a TypedFact) -> InferenceFact
[src]
impl From<Arc<Tensor>> for InferenceFact
[src]
pub fn from(t: Arc<Tensor>) -> InferenceFact
[src]
impl From<Tensor> for InferenceFact
[src]
pub fn from(t: Tensor) -> InferenceFact
[src]
impl Hash for InferenceFact
[src]
pub fn hash<__H>(&self, state: &mut __H) where
__H: Hasher,
[src]
__H: Hasher,
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]
pub fn eq(&self, other: &InferenceFact) -> bool
[src]
pub fn ne(&self, other: &InferenceFact) -> bool
[src]
impl SpecialOps<InferenceFact, Box<dyn InferenceOp + 'static, Global>> for Graph<InferenceFact, Box<dyn InferenceOp + 'static, Global>>
[src]
pub fn is_source(op: &Box<dyn InferenceOp + 'static, Global>) -> bool
[src]
pub fn create_dummy(&self) -> Box<dyn InferenceOp + '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<F, A> Future for Box<F, A> where
F: Unpin + Future + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;
[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<F, A> Future for Box<F, A> where
F: Unpin + Future + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;
pub fn create_source(
&self,
_fact: InferenceFact
) -> Box<dyn InferenceOp + '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<F, A> Future for Box<F, A> where
F: Unpin + Future + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;
[src]
&self,
_fact: InferenceFact
) -> Box<dyn InferenceOp + '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<F, A> Future for Box<F, A> where
F: Unpin + Future + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;
pub fn wire_node(
&mut self,
name: impl Into<String>,
op: impl Into<Box<dyn InferenceOp + 'static, Global>>,
inputs: &[OutletId]
) -> Result<SmallVec<[OutletId; 4]>, Error>
[src]
&mut self,
name: impl Into<String>,
op: impl Into<Box<dyn InferenceOp + 'static, Global>>,
inputs: &[OutletId]
) -> Result<SmallVec<[OutletId; 4]>, Error>
impl StructuralPartialEq for InferenceFact
[src]
impl<'a> TryFrom<&'a InferenceFact> for TypedFact
[src]
Auto Trait Implementations
impl RefUnwindSafe for InferenceFact
[src]
impl Send for InferenceFact
[src]
impl Sync for InferenceFact
[src]
impl Unpin for InferenceFact
[src]
impl UnwindSafe for InferenceFact
[src]
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,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut Tⓘ
[src]
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<F, A> Future for Box<F, A> where
F: Unpin + Future + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;
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<F, A> Future for Box<F, A> where
F: Unpin + Future + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;
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: Send + Sync + Any,
T: Send + Sync + Any,
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>,