pub struct TensorShape {
pub dims: Vec<DimSize>,
}Expand description
Tensor shape representation
Fields§
§dims: Vec<DimSize>Implementations§
Source§impl TensorShape
impl TensorShape
pub fn new(dims: Vec<DimSize>) -> Self
pub fn static_shape(sizes: Vec<usize>) -> Self
pub fn dynamic(rank: usize) -> Self
pub fn rank(&self) -> usize
pub fn is_static(&self) -> bool
pub fn as_static(&self) -> Option<Vec<usize>>
Sourcepub fn compatible_with(&self, other: &TensorShape) -> bool
pub fn compatible_with(&self, other: &TensorShape) -> bool
Check if two shapes are compatible (can broadcast or are equal)
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 · 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
Source§impl PartialEq for TensorShape
impl PartialEq for TensorShape
impl Eq 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 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