[−][src]Struct tract_core::analyser::types::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: TypeFact
shape: ShapeFact
value: ValueFact
Methods
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<ShapeFact>>(dt: DatumType, shape: S) -> InferenceFact
[src]
pub fn shape<S: Into<ShapeFact>>(shape: S) -> InferenceFact
[src]
pub fn with_datum_type(self, dt: DatumType) -> InferenceFact
[src]
pub fn with_shape<S: Into<ShapeFact>>(self, shape: S) -> InferenceFact
[src]
pub fn with_streaming_shape<S: IntoIterator<Item = Option<usize>>>(
self,
shape: S
) -> InferenceFact
[src]
self,
shape: S
) -> InferenceFact
pub fn stream_info(&self) -> TractResult<Option<StreamInfo>>
[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]
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_tensor_fact(&self) -> 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.
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 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<V: Into<Arc<Tensor>>> From<V> for InferenceFact
[src]
fn from(v: V) -> InferenceFact
[src]
impl ModelSpecialOps<InferenceFact, Box<dyn InferenceOp + 'static>> for InferenceModel
[src]
fn add_source(
&mut self,
name: impl Into<String>,
fact: InferenceFact
) -> TractResult<OutletId>
[src]
&mut self,
name: impl Into<String>,
fact: InferenceFact
) -> TractResult<OutletId>
fn create_dummy(&self) -> Box<dyn InferenceOp>
[src]
impl ModelWireNode<InferenceFact, Box<dyn InferenceOp + 'static>> for InferenceModel
[src]
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 PartialEq<InferenceFact> for InferenceFact
[src]
fn eq(&self, other: &InferenceFact) -> bool
[src]
fn ne(&self, other: &InferenceFact) -> bool
[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.
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,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Downcast for T where
T: Any,
[src]
T: Any,
fn into_any(self: Box<T>) -> Box<dyn Any + 'static>
[src]
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
[src]
fn as_any(&self) -> &(dyn Any + 'static)
[src]
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
[src]
impl<T> DowncastSync for T where
T: Send + Sync + Any,
[src]
T: Send + Sync + Any,
impl<T> DynClone for T where
T: Clone,
[src]
T: Clone,
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.
fn to_owned(&self) -> T
[src]
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.
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>,