pub trait ConstTensorOps<T, const N: usize, const D: usize>: TensorOps<T> {
// Required methods
fn shape_array(&self) -> &[usize; D];
fn data_array(&self) -> &[T; N];
fn data_mut_array(&mut self) -> &mut [T; N];
}Expand description
Operations only statically sized, non-allocating tensors can leverage.
Required Methods§
Sourcefn shape_array(&self) -> &[usize; D]
fn shape_array(&self) -> &[usize; D]
Provides the shape of the current tensor as an array.
Note: the builtin index_offset method will work immediately if the shape is stored row-major.
Sourcefn data_array(&self) -> &[T; N]
fn data_array(&self) -> &[T; N]
Provides the data of the current tensor in a slice of a generic T.
Note: the builtin index_offset method will work immediately if the data is stored row-major.
Sourcefn data_mut_array(&mut self) -> &mut [T; N]
fn data_mut_array(&mut self) -> &mut [T; N]
Provides the data of the current tensor in a slice of a generic T.
Note: the builtin index_offset method will work immediately if the data is stored row-major.