Skip to main content

IndexerDynamicAPI

Trait IndexerDynamicAPI 

Source
pub trait IndexerDynamicAPI: IndexerPreserveAPI {
    // Required methods
    fn dim_slice(
        &self,
        indexers: &[Indexer],
    ) -> Result<Layout<Vec<usize>>, Error>;
    fn dim_split_at(
        &self,
        axis: isize,
    ) -> Result<(Layout<Vec<usize>>, Layout<Vec<usize>>), Error>;
    fn dim_split_axes(
        &self,
        axes: &[isize],
    ) -> Result<(Layout<Vec<usize>>, Layout<Vec<usize>>), Error>;
}

Required Methods§

Source

fn dim_slice(&self, indexers: &[Indexer]) -> Result<Layout<Vec<usize>>, Error>

Index tensor by a list of indexers.

Source

fn dim_split_at( &self, axis: isize, ) -> Result<(Layout<Vec<usize>>, Layout<Vec<usize>>), Error>

Split current layout into two layouts at axis, with offset unchanged.

Source

fn dim_split_axes( &self, axes: &[isize], ) -> Result<(Layout<Vec<usize>>, Layout<Vec<usize>>), Error>

Split current layout into two layouts by axes, with offset unchanged. Returned layouts will be (layout_axes, layout_rest).

This function is designed for reduction, to split the layout into axes to be reduced and the rest.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§