Struct tract_tensorflow::prelude::InferenceFact [−][src]
pub struct InferenceFact { pub datum_type: GenericFactoid<DatumType>, pub shape: ShapeFactoid, pub value: GenericFactoid<Arc<Tensor>>, }
Expand description
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]
impl InferenceFact
[src]pub fn new() -> 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]
impl Clone for InferenceFact
[src]pub fn clone(&self) -> InferenceFact
[src]
pub fn clone(&self) -> InferenceFact
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl Debug for InferenceFact
[src]
impl Debug for InferenceFact
[src]impl Default for InferenceFact
[src]
impl Default for InferenceFact
[src]pub fn default() -> InferenceFact
[src]
pub fn default() -> InferenceFact
[src]Returns the “default value” for a type. Read more
impl Fact for InferenceFact
[src]
impl Fact for InferenceFact
[src]impl Factoid for InferenceFact
[src]
impl Factoid for InferenceFact
[src]pub fn concretize(&self) -> Option<<InferenceFact as Factoid>::Concrete>
[src]
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]
pub fn unify(&self, other: &InferenceFact) -> Result<InferenceFact, Error>
[src]Tries to unify the fact with another fact of the same type.
type Concrete = Arc<Tensor>
fn is_concrete(&self) -> bool
[src]
fn is_concrete(&self) -> bool
[src]Returns whether the value is fully determined.
fn unify_with(&mut self, other: &Self) -> Result<bool, Error>
[src]
fn unify_with(&mut self, other: &Self) -> Result<bool, Error>
[src]Tries to unify the fact with another fact of the same type and update self. Read more
impl<'a> From<&'a Arc<Tensor>> for InferenceFact
[src]
impl<'a> From<&'a Arc<Tensor>> for InferenceFact
[src]pub fn from(t: &'a Arc<Tensor>) -> InferenceFact
[src]
pub fn from(t: &'a Arc<Tensor>) -> InferenceFact
[src]Performs the conversion.
impl<'a> From<&'a InferenceFact> for InferenceFact
[src]
impl<'a> From<&'a InferenceFact> for InferenceFact
[src]pub fn from(t: &'a InferenceFact) -> InferenceFact
[src]
pub fn from(t: &'a InferenceFact) -> InferenceFact
[src]Performs the conversion.
impl<'a> From<&'a Tensor> for InferenceFact
[src]
impl<'a> From<&'a Tensor> for InferenceFact
[src]pub fn from(t: &'a Tensor) -> InferenceFact
[src]
pub fn from(t: &'a Tensor) -> InferenceFact
[src]Performs the conversion.
impl<'a> From<&'a TypedFact> for InferenceFact
[src]
impl<'a> From<&'a TypedFact> for InferenceFact
[src]pub fn from(t: &'a TypedFact) -> InferenceFact
[src]
pub fn from(t: &'a TypedFact) -> InferenceFact
[src]Performs the conversion.
impl From<Arc<Tensor>> for InferenceFact
[src]
impl From<Arc<Tensor>> for InferenceFact
[src]pub fn from(t: Arc<Tensor>) -> InferenceFact
[src]
pub fn from(t: Arc<Tensor>) -> InferenceFact
[src]Performs the conversion.
impl From<Tensor> for InferenceFact
[src]
impl From<Tensor> for InferenceFact
[src]pub fn from(t: Tensor) -> InferenceFact
[src]
pub fn from(t: Tensor) -> InferenceFact
[src]Performs the conversion.
impl Hash for InferenceFact
[src]
impl Hash for InferenceFact
[src]impl PartialEq<InferenceFact> for InferenceFact
[src]
impl PartialEq<InferenceFact> for InferenceFact
[src]pub fn eq(&self, other: &InferenceFact) -> bool
[src]
pub fn eq(&self, other: &InferenceFact) -> bool
[src]This method tests for self
and other
values to be equal, and is used
by ==
. Read more
pub fn ne(&self, other: &InferenceFact) -> bool
[src]
pub fn ne(&self, other: &InferenceFact) -> bool
[src]This method tests for !=
.
impl SpecialOps<InferenceFact, Box<dyn InferenceOp + 'static, Global>> for Graph<InferenceFact, Box<dyn InferenceOp + 'static, Global>>
[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: Future + Unpin + ?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: Future + Unpin + ?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: Future + Unpin + ?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: Future + Unpin + ?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<'a> TryFrom<&'a InferenceFact> for TypedFact
[src]
impl<'a> TryFrom<&'a InferenceFact> for TypedFact
[src]impl StructuralPartialEq for InferenceFact
[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> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
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: Future + Unpin + ?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(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: Future + Unpin + ?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;
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
pub fn as_any(&self) -> &(dyn Any + 'static)
pub fn as_any(&self) -> &(dyn Any + 'static)
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more