pub trait Shape: Debug {
Show 18 methods
// Required method
fn shape(&self) -> &[usize];
// Provided methods
fn size(&self) -> usize { ... }
fn shape_at<I: Dim>(&self, i: I) -> usize { ... }
fn shape_before<const N: usize>(&self) -> [usize; N] { ... }
fn shape_of<D: Dims>(&self, d: D) -> Vec<usize> { ... }
fn size_of<D: Dims>(&self, d: D) -> usize { ... }
fn ndim(&self) -> usize { ... }
fn dim<I: Dim>(&self, i: I) -> usize { ... }
fn dims<D: Dims>(&self, d: D) -> Vec<usize> { ... }
fn shape_transpose(&self, dim0: usize, dim1: usize) -> Vec<usize> { ... }
fn shape_eq<S: Shape + ?Sized>(&self, rhs: &S) -> bool { ... }
fn shape_ndim_eq<S: Shape + ?Sized>(&self, rhs: &S) -> bool { ... }
fn shape_size_eq<S: Shape + ?Sized>(&self, rhs: &S) -> bool { ... }
fn shape_expand_left<T: Shape + ?Sized>(&self, rhs: &T) -> Vec<usize> { ... }
fn shape_broadcast<T: Shape + ?Sized>(&self, rhs: &T) -> Result<Vec<usize>> { ... }
fn shape_broadcast_matmul<S: Shape + ?Sized>(
&self,
rhs: &S
) -> Result<Vec<usize>> { ... }
fn shape_reduce<T: AsRef<[usize]>>(
&self,
dims: T,
keep_dim: bool
) -> Vec<usize> { ... }
fn shape_conv<S: Shape + ?Sized>(
&self,
kernel: &S,
padding: &[usize],
stride: &[usize],
dilation: &[usize],
groups: usize
) -> Result<Vec<usize>> { ... }
}
Required Methods§
Provided Methods§
fn size(&self) -> usize
fn shape_at<I: Dim>(&self, i: I) -> usize
fn shape_before<const N: usize>(&self) -> [usize; N]
fn shape_of<D: Dims>(&self, d: D) -> Vec<usize>
fn size_of<D: Dims>(&self, d: D) -> usize
fn ndim(&self) -> usize
fn dim<I: Dim>(&self, i: I) -> usize
fn dims<D: Dims>(&self, d: D) -> Vec<usize>
fn shape_transpose(&self, dim0: usize, dim1: usize) -> Vec<usize>
fn shape_eq<S: Shape + ?Sized>(&self, rhs: &S) -> bool
fn shape_ndim_eq<S: Shape + ?Sized>(&self, rhs: &S) -> bool
fn shape_size_eq<S: Shape + ?Sized>(&self, rhs: &S) -> bool
fn shape_expand_left<T: Shape + ?Sized>(&self, rhs: &T) -> Vec<usize>
fn shape_broadcast<T: Shape + ?Sized>(&self, rhs: &T) -> Result<Vec<usize>>
fn shape_broadcast_matmul<S: Shape + ?Sized>( &self, rhs: &S ) -> Result<Vec<usize>>
fn shape_reduce<T: AsRef<[usize]>>(&self, dims: T, keep_dim: bool) -> Vec<usize>
fn shape_conv<S: Shape + ?Sized>( &self, kernel: &S, padding: &[usize], stride: &[usize], dilation: &[usize], groups: usize ) -> Result<Vec<usize>>
Object Safety§
This trait is not object safe.