[−][src]Struct tract_hir::infer::ShapeFactoid
Partial information about a shape.
A basic example of a shape fact is shapefactoid![1, 2]
, which corresponds to
the shape [1, 2]
in Arc_
in facts to denote unknown
dimensions (e.g. shapefactoid![1, 2, _]
corresponds to any shape [1, 2, k]
with k
a non-negative integer). We can also use ..
at the end of a fact
to only specify its first dimensions, so shapefactoid![1, 2; ..]
matches any
shape that starts with [1, 2]
(e.g. [1, 2, i]
or [1, 2, i, j]
), while
shapefactoid![..]
matches any shape.
Implementations
impl ShapeFactoid
[src]
pub fn open(dims: TVec<DimFact>) -> ShapeFactoid
[src]
Constructs an open shape fact.
pub fn is_open(&self) -> bool
[src]
pub fn closed(dims: TVec<DimFact>) -> ShapeFactoid
[src]
Constructs a closed shape fact.
pub fn rank(&self) -> IntFactoid
[src]
pub fn ensure_rank_at_least(&mut self, n: usize) -> bool
[src]
pub fn dim(&self, i: usize) -> Option<DimFact>
[src]
pub fn set_dim(&mut self, i: usize, d: TDim) -> bool
[src]
pub fn dims(&self) -> impl Iterator<Item = DimFact>
[src]
pub fn stream_info(&self) -> TractResult<Option<StreamFact>>
[src]
pub fn as_concrete_finite(&self) -> TractResult<Option<TVec<usize>>>
[src]
Trait Implementations
impl Clone for ShapeFactoid
[src]
fn clone(&self) -> ShapeFactoid
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for ShapeFactoid
[src]
impl Default for ShapeFactoid
[src]
fn default() -> ShapeFactoid
[src]
Returns the most general shape fact possible.
impl Factoid for ShapeFactoid
[src]
type Concrete = TVec<TDim>
fn concretize(self: &ShapeFactoid) -> Option<TVec<TDim>>
[src]
Tries to transform the fact into a Vec<usize>
, or returns None
.
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<D: ToDim, I: IntoIterator<Item = D>> From<I> for ShapeFactoid
[src]
fn from(it: I) -> ShapeFactoid
[src]
impl FromIterator<TDim> for ShapeFactoid
[src]
fn from_iter<I: IntoIterator<Item = TDim>>(iter: I) -> ShapeFactoid
[src]
Converts an iterator over usize into a closed shape.
impl FromIterator<usize> for ShapeFactoid
[src]
fn from_iter<I: IntoIterator<Item = usize>>(iter: I) -> ShapeFactoid
[src]
Converts an iterator over usize into a closed shape.
impl Hash for ShapeFactoid
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl IntoExp<ShapeFactoid> for ShapeFactoid
[src]
fn bex(self) -> Exp<ShapeFactoid>
[src]
impl IntoExp<ShapeFactoid> for ShapeProxy
[src]
fn bex(self) -> Exp<ShapeFactoid>
[src]
impl<'a> IntoExp<ShapeFactoid> for &'a ShapeProxy
[src]
fn bex(self) -> Exp<ShapeFactoid>
[src]
impl IntoExp<ShapeFactoid> for TVec<TDim>
[src]
fn bex(self) -> Exp<ShapeFactoid>
[src]
impl Output for ShapeFactoid
[src]
fn into_wrapped(source: Self) -> Wrapped
[src]
fn from_wrapped(wrapped: Wrapped) -> TractResult<ShapeFactoid>
[src]
fn wrap(self) -> Wrapped
[src]
impl PartialEq<ShapeFactoid> for ShapeFactoid
[src]
fn eq(&self, other: &ShapeFactoid) -> bool
[src]
fn ne(&self, other: &ShapeFactoid) -> bool
[src]
impl StructuralPartialEq for ShapeFactoid
[src]
Auto Trait Implementations
impl RefUnwindSafe for ShapeFactoid
impl Send for ShapeFactoid
impl Sync for ShapeFactoid
impl Unpin for ShapeFactoid
impl UnwindSafe for ShapeFactoid
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,
T: Any,
fn into_any(self: Box<T>) -> Box<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn as_any(&self) -> &(dyn Any + 'static)
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,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, E> IntoExp<T> for E where
E: 'static + TExp<T>,
[src]
E: 'static + TExp<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>,