M

Trait M 

Source
pub trait M: Debug + Clone {
    const SIZE: usize;

    // Required methods
    fn to_value() -> Mapping;
    fn map(i: usize) -> Option<Index>;
}
Expand description

Mapping expression that describes memory layout and computes size for a given shape.

Required Associated Constants§

Source

const SIZE: usize

The computed size for the given shape.

Required Methods§

Source

fn to_value() -> Mapping

Converts the mapping expression type into a value.

Source

fn map(i: usize) -> Option<Index>

Converts a buffer index to a tensor index, returning None if out-of-bounds.

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§

Source§

impl M for Identity

Source§

const SIZE: usize = 1usize

Source§

impl<L, R> M for Pair<L, R>
where L: M, R: M,

Source§

impl<L, const SIZE: usize> M for Modulo<L, SIZE>
where L: M,

Source§

impl<L, const SIZE: usize> M for Padding<L, SIZE>
where L: M,

Source§

const SIZE: usize = SIZE

Source§

impl<L, const SIZE: usize> M for Resize<L, SIZE>
where L: M,

Source§

const SIZE: usize = SIZE

Source§

impl<L, const SIZE: usize> M for Stride<L, SIZE>
where L: M,

Source§

impl<S> M for Symbol<S>
where S: AxisName,

Source§

const SIZE: usize = S::SIZE