[−][src]Struct tract_core::model::ShapeInfo
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 set_dim(&mut self, i: usize, dim: TDim) -> TractResult<()>[src]
Set the i-th axis dimension.
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.
pub fn from_dims<T: AsRef<[TDim]> + Debug>(it: T) -> TractResult<ShapeInfo>[src]
Trait Implementations
impl Clone for ShapeInfo[src]
impl PartialEq<ShapeInfo> for ShapeInfo[src]
impl Debug for ShapeInfo[src]
impl TryFrom<()> for ShapeInfo[src]
type Error = TractError
The type returned in the event of a conversion error.
fn try_from(_it: ()) -> TractResult<ShapeInfo>[src]
impl<'_> TryFrom<&'_ [TDim]> for ShapeInfo[src]
type Error = TractError
The type returned in the event of a conversion error.
fn try_from(it: &[TDim]) -> TractResult<ShapeInfo>[src]
impl<'_> TryFrom<&'_ [usize]> for ShapeInfo[src]
type Error = TractError
The type returned in the event of a conversion error.
fn try_from(it: &[usize]) -> TractResult<ShapeInfo>[src]
Auto Trait Implementations
impl Send for ShapeInfo
impl Sync for ShapeInfo
impl Unpin for ShapeInfo
impl UnwindSafe for ShapeInfo
impl RefUnwindSafe for ShapeInfo
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> From<T> for T[src]
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
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> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
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> Clone for T where
T: Clone, [src]
T: Clone,