Skip to main content

SliceOperator

Trait SliceOperator 

Source
pub trait SliceOperator<E>: CubeType{
    // Provided methods
    fn slice(&self, start: usize, end: usize) -> Slice<E>  { ... }
    fn to_slice(&self) -> Slice<E>  { ... }
    fn __expand_slice(
        scope: &mut Scope,
        this: Self::ExpandType,
        start: <usize as CubeType>::ExpandType,
        end: <usize as CubeType>::ExpandType,
    ) -> <Slice<E> as CubeType>::ExpandType  { ... }
    fn __expand_to_slice(
        scope: &mut Scope,
        this: Self::ExpandType,
    ) -> <Slice<E> as CubeType>::ExpandType  { ... }
}

Provided Methods§

Source

fn slice(&self, start: usize, end: usize) -> Slice<E>

Return a read-only view of all elements comprise between the start and end indices. In checked mode, if the end index is out-of-bound, it is replaced by the length of self.

Source

fn to_slice(&self) -> Slice<E>

Reinterprete the current type as a read-only slice.

Source

fn __expand_slice( scope: &mut Scope, this: Self::ExpandType, start: <usize as CubeType>::ExpandType, end: <usize as CubeType>::ExpandType, ) -> <Slice<E> as CubeType>::ExpandType

Source

fn __expand_to_slice( scope: &mut Scope, this: Self::ExpandType, ) -> <Slice<E> as CubeType>::ExpandType

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<'a, T, L> SliceOperator<T> for &'a L
where T: CubePrimitive, L: SliceOperator<T>, &'a L: CubeType<ExpandType = <L as CubeType>::ExpandType>,

Source§

impl<'a, T, L> SliceOperator<T> for &'a mut L
where T: CubePrimitive, L: SliceOperator<T>, &'a mut L: CubeType<ExpandType = <L as CubeType>::ExpandType>,

Source§

impl<E, N, IO> SliceOperator<Vector<E, N>> for VirtualTensor<E, N, IO>
where E: Numeric, N: Size, IO: Clone,

Implementors§

Source§

impl<E> SliceOperator<E> for Array<E>
where E: CubePrimitive,

Source§

impl<E> SliceOperator<E> for SharedMemory<E>
where E: CubePrimitive,

Source§

impl<E> SliceOperator<E> for Tensor<E>
where E: CubePrimitive,

Source§

impl<E, IO> SliceOperator<E> for Slice<E, IO>