[][src]Struct tract_core::model::ShapeInfo

pub struct ShapeInfo {
    pub stream_info: Option<StreamInfo>,
    // some fields omitted
}

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<StreamInfo>

Optional information for streaming tensors. None for regular tensors.

Methods

impl ShapeInfo[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 as_finite(&self) -> Option<&[usize]>[src]

Shape of the tensor, unless it is streaming.

pub fn iter<'a>(&'a self) -> impl Iterator<Item = TDim> + 'a[src]

Iterator over dimension of the shape.

pub fn to_tvec(&self) -> TVec<TDim>[src]

Convert the shape to an array of extended dimensions.

pub fn to_shape_fact(&self) -> ShapeFact[src]

Convert the shape to a fully determined shape fact.

Trait Implementations

impl PartialEq<ShapeInfo> for ShapeInfo[src]

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests for !=.

impl Clone for ShapeInfo[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<T: AsRef<[usize]>> From<T> for ShapeInfo[src]

impl Debug for ShapeInfo[src]

Auto Trait Implementations

impl Send for ShapeInfo

impl Sync for ShapeInfo

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Downcast for T where
    T: Any
[src]

impl<T> Clone for T where
    T: Clone
[src]