pub struct TensorShape {
pub dims: Vec<Dimension>,
}Expand description
A multi-dimensional tensor shape supporting mixed static/dynamic dimensions.
For example, [batch, 224, 224, 3] where batch is dynamic and spatial
dimensions are fixed.
Fields§
§dims: Vec<Dimension>The dimensions of the tensor.
Implementations§
Source§impl TensorShape
impl TensorShape
Sourcepub fn all_dynamic(rank: usize) -> Self
pub fn all_dynamic(rank: usize) -> Self
Create a shape where all dimensions are dynamic (unnamed).
Sourcepub fn is_fully_static(&self) -> bool
pub fn is_fully_static(&self) -> bool
Returns true if all dimensions are statically known.
Sourcepub fn is_fully_dynamic(&self) -> bool
pub fn is_fully_dynamic(&self) -> bool
Returns true if all dimensions are dynamic (unnamed).
Sourcepub fn has_dynamic_dims(&self) -> bool
pub fn has_dynamic_dims(&self) -> bool
Returns true if any dimension is not statically known
(either dynamic or symbolic).
Trait Implementations§
Source§impl Clone for TensorShape
impl Clone for TensorShape
Source§fn clone(&self) -> TensorShape
fn clone(&self) -> TensorShape
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TensorShape
impl Debug for TensorShape
impl Eq for TensorShape
Source§impl Hash for TensorShape
impl Hash for TensorShape
Source§impl PartialEq for TensorShape
impl PartialEq for TensorShape
impl StructuralPartialEq for TensorShape
Auto Trait Implementations§
impl Freeze for TensorShape
impl RefUnwindSafe for TensorShape
impl Send for TensorShape
impl Sync for TensorShape
impl Unpin for TensorShape
impl UnsafeUnpin for TensorShape
impl UnwindSafe for TensorShape
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more