Skip to main content

TensorShape

Trait TensorShape 

Source
pub trait TensorShape: Sealed {
    const SIZE: usize;
    const RANK: usize;

    // Required method
    fn offset(index: &[usize]) -> usize;
}

Required Associated Constants§

Required Methods§

Source

fn offset(index: &[usize]) -> 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.

Implementors§

Source§

impl TensorShape for Nil

Source§

const SIZE: usize = 1

Source§

const RANK: usize = 0

Source§

impl<const N: usize, Rest> TensorShape for Dim<N, Rest>
where Rest: TensorShape,