Trait rten_tensor::IntoLayout

source ·
pub trait IntoLayout: AsRef<[usize]> {
    type Layout: MutLayout;

    // Required method
    fn into_layout(self) -> Self::Layout;
}
Expand description

Trait for shapes which can be used to create a contiguous layout.

This is implemented for [usize; N] for creating static-rank layouts from arrays, and &[usize] for creating dynamic-rank layouts from slices.

Required Associated Types§

source

type Layout: MutLayout

The type of layout produced from this shape.

Required Methods§

source

fn into_layout(self) -> Self::Layout

Convert this shape into a contiguous layout.

Implementations on Foreign Types§

source§

impl<'a> IntoLayout for &'a [usize]

source§

impl<const N: usize> IntoLayout for [usize; N]

Implementors§