candle_core::shape

Trait Dims

Source
pub trait Dims: Sized {
    // Required method
    fn to_indexes_internal(
        self,
        shape: &Shape,
        op: &'static str,
    ) -> Result<Vec<usize>>;

    // Provided method
    fn to_indexes(self, shape: &Shape, op: &'static str) -> Result<Vec<usize>> { ... }
}

Required Methods§

Source

fn to_indexes_internal( self, shape: &Shape, op: &'static str, ) -> Result<Vec<usize>>

Provided Methods§

Source

fn to_indexes(self, shape: &Shape, op: &'static str) -> Result<Vec<usize>>

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.

Implementations on Foreign Types§

Source§

impl Dims for &[usize]

Source§

fn to_indexes_internal(self, _: &Shape, _: &'static str) -> Result<Vec<usize>>

Source§

impl Dims for ()

Source§

fn to_indexes_internal(self, _: &Shape, _: &'static str) -> Result<Vec<usize>>

Source§

impl Dims for Vec<usize>

Source§

fn to_indexes_internal(self, _: &Shape, _: &'static str) -> Result<Vec<usize>>

Source§

impl<D1: Dim, D2: Dim> Dims for (D1, D2)

Source§

fn to_indexes_internal( self, shape: &Shape, op: &'static str, ) -> Result<Vec<usize>>

Source§

impl<D1: Dim, D2: Dim, D3: Dim> Dims for (D1, D2, D3)

Source§

fn to_indexes_internal( self, shape: &Shape, op: &'static str, ) -> Result<Vec<usize>>

Source§

impl<D1: Dim, D2: Dim, D3: Dim, D4: Dim> Dims for (D1, D2, D3, D4)

Source§

fn to_indexes_internal( self, shape: &Shape, op: &'static str, ) -> Result<Vec<usize>>

Source§

impl<D1: Dim, D2: Dim, D3: Dim, D4: Dim, D5: Dim> Dims for (D1, D2, D3, D4, D5)

Source§

fn to_indexes_internal( self, shape: &Shape, op: &'static str, ) -> Result<Vec<usize>>

Source§

impl<D1: Dim, D2: Dim, D3: Dim, D4: Dim, D5: Dim, D6: Dim> Dims for (D1, D2, D3, D4, D5, D6)

Source§

fn to_indexes_internal( self, shape: &Shape, op: &'static str, ) -> Result<Vec<usize>>

Source§

impl<D: Dim> Dims for (D,)

Source§

fn to_indexes_internal( self, shape: &Shape, op: &'static str, ) -> Result<Vec<usize>>

Source§

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

Source§

fn to_indexes_internal(self, _: &Shape, _: &'static str) -> Result<Vec<usize>>

Implementors§

Source§

impl<D: Dim + Sized> Dims for D