pub trait Shape: Debug {
// Required methods
fn dims(&self) -> &[usize];
fn ndim(&self) -> usize;
// Provided methods
fn size(&self) -> usize { ... }
fn to_vec(&self) -> Vec<usize> { ... }
fn shape_transpose(&self) -> Vec<usize> { ... }
fn shape_at(&self, index: usize) -> usize
where Self: Sized { ... }
fn shape_eq(&self, rhs: &impl Shape) -> bool
where Self: Sized { ... }
fn shape_ndim_eq(&self, rhs: &impl Shape) -> bool
where Self: Sized { ... }
fn shape_size_eq(&self, rhs: &impl Shape) -> bool
where Self: Sized { ... }
fn shape_broadcast(&self, rhs: &impl Shape) -> Result<Vec<usize>>
where Self: Sized { ... }
fn shape_broadcast_matmul(&self, rhs: &impl Shape) -> Result<Vec<usize>>
where Self: Sized { ... }
}