[−][src]Struct tract_core::analyser::types::TensorFact
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 TensorFact
[src]
impl TensorFact
pub fn new() -> TensorFact
[src]
pub fn new() -> TensorFact
Constructs the most general tensor fact possible.
pub fn any() -> TensorFact
[src]
pub fn any() -> TensorFact
pub fn dt(dt: DatumType) -> TensorFact
[src]
pub fn dt(dt: DatumType) -> TensorFact
pub fn dt_shape<S: Into<ShapeFact>>(dt: DatumType, shape: S) -> TensorFact
[src]
pub fn dt_shape<S: Into<ShapeFact>>(dt: DatumType, shape: S) -> TensorFact
pub fn shape<S: Into<ShapeFact>>(shape: S) -> TensorFact
[src]
pub fn shape<S: Into<ShapeFact>>(shape: S) -> TensorFact
pub fn with_datum_type(self, dt: DatumType) -> TensorFact
[src]
pub fn with_datum_type(self, dt: DatumType) -> TensorFact
pub fn with_shape<S: Into<ShapeFact>>(self, shape: S) -> TensorFact
[src]
pub fn with_shape<S: Into<ShapeFact>>(self, shape: S) -> TensorFact
pub fn with_streaming_shape<S: IntoIterator<Item = Option<usize>>>(
self,
shape: S
) -> TensorFact
[src]
pub fn with_streaming_shape<S: IntoIterator<Item = Option<usize>>>(
self,
shape: S
) -> TensorFact
pub fn stream_info(&self) -> TractResult<Option<StreamInfo>>
[src]
pub fn stream_info(&self) -> TractResult<Option<StreamInfo>>
pub fn reduce(&mut self)
[src]
pub fn reduce(&mut self)
pub fn reduced(self) -> Self
[src]
pub fn reduced(self) -> Self
Trait Implementations
impl Fact for TensorFact
[src]
impl Fact for TensorFact
type Concrete = Tensor
fn concretize(&self) -> Option<Self::Concrete>
[src]
fn concretize(&self) -> Option<Self::Concrete>
Tries to transform the fact into a concrete value.
fn unify(&self, other: &Self) -> TractResult<Self>
[src]
fn unify(&self, other: &Self) -> TractResult<Self>
Tries to unify the fact with another fact of the same type.
fn is_concrete(&self) -> bool
[src]
fn is_concrete(&self) -> bool
Returns whether the value is fully determined.
impl Default for TensorFact
[src]
impl Default for TensorFact
fn default() -> TensorFact
[src]
fn default() -> TensorFact
Returns the "default value" for a type. Read more
impl PartialEq<TensorFact> for TensorFact
[src]
impl PartialEq<TensorFact> for TensorFact
fn eq(&self, other: &TensorFact) -> bool
[src]
fn eq(&self, other: &TensorFact) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &TensorFact) -> bool
[src]
fn ne(&self, other: &TensorFact) -> bool
This method tests for !=
.
impl<T: Into<Tensor>> From<T> for TensorFact
[src]
impl<T: Into<Tensor>> From<T> for TensorFact
fn from(t: T) -> TensorFact
[src]
fn from(t: T) -> TensorFact
Performs the conversion.
impl Clone for TensorFact
[src]
impl Clone for TensorFact
fn clone(&self) -> TensorFact
[src]
fn clone(&self) -> TensorFact
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)
Performs copy-assignment from source
. Read more
impl Debug for TensorFact
[src]
impl Debug for TensorFact
Auto Trait Implementations
impl Send for TensorFact
impl Send for TensorFact
impl Sync for TensorFact
impl Sync for TensorFact
Blanket Implementations
impl<PB, Tract> ToTract for PB where
Tract: Tractify<PB>,
[src]
impl<PB, Tract> ToTract for PB where
Tract: Tractify<PB>,
fn tractify(&Self) -> Result<Tract, TractError>
[src]
fn tractify(&Self) -> Result<Tract, TractError>
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
type Owned = T
fn to_owned(&self) -> T
[src]
fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
fn clone_into(&self, target: &mut T)
[src]
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
try_from
)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
try_from
)Performs the conversion.
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Gets the TypeId
of self
. Read more
impl<T> Clone for T where
T: Clone,
[src]
impl<T> Clone for T where
T: Clone,
impl<T> Downcast for T where
T: Any,
[src]
impl<T> Downcast for T where
T: Any,
fn into_any(self: Box<T>) -> Box<dyn Any + 'static>
[src]
fn into_any(self: Box<T>) -> Box<dyn Any + 'static>
Convert Box<Trait>
(where Trait: Downcast
) to Box<Any>
. Box<Any>
can then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
fn as_any(&self) -> &(dyn Any + 'static)
[src]
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
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
[src]
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