[−][src]Struct tract_nnef::prelude::ShapeFact
Fully determined dimension of a tensor.
Tensors in tract can have one streaming dimension. TDim generalize the
regular tensor dimensions (usize) to arithmetic expressions of S
, the
(sometimes hypothetical) tensor length on the streaming axis.
Fields
stream_info: Option<StreamFact>
Optional information for streaming tensors. None for regular tensors.
Implementations
impl ShapeFact
[src]
pub fn rank(&self) -> usize
[src]
Rank of the tensor.
pub fn dim(&self, i: usize) -> TDim
[src]
Extended dimension of the i-th axis.
The TDim will wrap a plain integer for regular (non-streaming) tensors.
pub fn set_dim(&mut self, i: usize, dim: TDim) -> Result<(), TractError>
[src]
Set the i-th axis dimension.
pub fn insert_axis(&mut self, axis: usize) -> Result<(), TractError>
[src]
pub fn remove_axis(&mut self, axis: usize) -> Result<(), TractError>
[src]
pub fn as_finite(&self) -> Option<&[usize]>
[src]
Shape of the tensor, unless it is streaming.
pub fn iter(&'a self) -> impl Iterator<Item = TDim> + 'a
[src]
Iterator over dimension of the shape.
pub fn to_tvec(&self) -> SmallVec<[TDim; 4]>
[src]
Convert the shape to an array of extended dimensions.
pub fn from_dims<T>(it: T) -> Result<ShapeFact, TractError> where
T: AsRef<[TDim]> + Debug,
[src]
T: AsRef<[TDim]> + Debug,
Trait Implementations
impl Clone for ShapeFact
[src]
impl Debug for ShapeFact
[src]
impl Hash for ShapeFact
[src]
fn hash<__H>(&self, state: &mut __H) where
__H: Hasher,
[src]
__H: Hasher,
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<ShapeFact> for ShapeFact
[src]
impl<'_> TryFrom<&'_ [TDim]> for ShapeFact
[src]
type Error = TractError
The type returned in the event of a conversion error.
fn try_from(it: &[TDim]) -> Result<ShapeFact, TractError>
[src]
impl<'_> TryFrom<&'_ [usize]> for ShapeFact
[src]
type Error = TractError
The type returned in the event of a conversion error.
fn try_from(it: &[usize]) -> Result<ShapeFact, TractError>
[src]
impl TryFrom<()> for ShapeFact
[src]
type Error = TractError
The type returned in the event of a conversion error.
fn try_from(_it: ()) -> Result<ShapeFact, TractError>
[src]
Auto Trait Implementations
impl RefUnwindSafe for ShapeFact
impl Send for ShapeFact
impl Sync for ShapeFact
impl Unpin for ShapeFact
impl UnwindSafe for ShapeFact
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,
fn borrow(&self) -> &TⓘNotable traits for &'_ mut W
impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;impl<'_, F> Future for &'_ mut F where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;
[src]
Notable traits for &'_ mut W
impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;impl<'_, F> Future for &'_ mut F where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut TⓘNotable traits for &'_ mut W
impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;impl<'_, F> Future for &'_ mut F where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;
[src]
Notable traits for &'_ mut W
impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;impl<'_, F> Future for &'_ mut F where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;
impl<T> Downcast for T where
T: Any,
T: Any,
fn into_any(self: Box<T>) -> Box<dyn Any + 'static>ⓘNotable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
Notable traits for Box<W>
impl<W> Write for Box<W> where
W: Write + ?Sized, impl<R> Read for Box<R> where
R: Read + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
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> 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>,