ConstTensorOps

Trait ConstTensorOps 

Source
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§

Source

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.

Source

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.

Source

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.

Implementors§

Source§

impl<T, const N: usize, const D: usize, const LANES: usize> ConstTensorOps<T, N, D> for ArrTensor<T, N, D, LANES>