Trait ella_tensor::Shape

source ·
pub trait Shape: Debug + Send + Sync + Clone + Eq + PartialEq<Self> + IndexMut<usize, Output = usize> + AsRef<[usize]> + AsMut<[usize]> + 'static {
    type Smaller: Shape;
    type Larger: Shape + RemoveAxis;

    const NDIM: Option<usize>;

    // Required methods
    fn ndim(&self) -> usize;
    fn size(&self) -> usize;
    fn zeros(ndim: usize) -> Self;

    // Provided methods
    fn slice(&self) -> &[usize] { ... }
    fn slice_mut(&mut self) -> &mut [usize] { ... }
    fn as_dyn(&self) -> Dyn { ... }
    fn broadcast<In, Out>(&self, other: &In) -> Result<Out, Error>
       where In: Shape,
             Out: Shape { ... }
    fn indices(&self) -> ShapeIndexIter<Self>  { ... }
    fn axis(&self, axis: Axis) -> usize { ... }
}

Required Associated Types§

Required Associated Constants§

Required Methods§

source

fn ndim(&self) -> usize

source

fn size(&self) -> usize

source

fn zeros(ndim: usize) -> Self

Provided Methods§

source

fn slice(&self) -> &[usize]

source

fn slice_mut(&mut self) -> &mut [usize]

source

fn as_dyn(&self) -> Dyn

source

fn broadcast<In, Out>(&self, other: &In) -> Result<Out, Error>where In: Shape, Out: Shape,

source

fn indices(&self) -> ShapeIndexIter<Self>

source

fn axis(&self, axis: Axis) -> usize

Implementors§

source§

impl Shape for Const<0>

source§

const NDIM: Option<usize> = Some(0)

§

type Smaller = Const<0>

§

type Larger = Const<ella_common::::shape::{impl#42}::Larger::{constant#0}>

source§

impl Shape for Const<1>

source§

const NDIM: Option<usize> = Some(1)

§

type Smaller = Const<ella_common::::shape::{impl#45}::Smaller::{constant#0}>

§

type Larger = Const<ella_common::::shape::{impl#45}::Larger::{constant#0}>

source§

impl Shape for Const<2>

source§

const NDIM: Option<usize> = Some(2)

§

type Smaller = Const<ella_common::::shape::{impl#48}::Smaller::{constant#0}>

§

type Larger = Const<ella_common::::shape::{impl#48}::Larger::{constant#0}>

source§

impl Shape for Const<3>

source§

const NDIM: Option<usize> = Some(3)

§

type Smaller = Const<ella_common::::shape::{impl#51}::Smaller::{constant#0}>

§

type Larger = Const<ella_common::::shape::{impl#51}::Larger::{constant#0}>

source§

impl Shape for Const<4>

source§

const NDIM: Option<usize> = Some(4)

§

type Smaller = Const<ella_common::::shape::{impl#54}::Smaller::{constant#0}>

§

type Larger = Const<ella_common::::shape::{impl#54}::Larger::{constant#0}>

source§

impl Shape for Const<5>

source§

const NDIM: Option<usize> = Some(5)

§

type Smaller = Const<ella_common::::shape::{impl#57}::Smaller::{constant#0}>

§

type Larger = Const<ella_common::::shape::{impl#57}::Larger::{constant#0}>

source§

impl Shape for Const<6>

source§

const NDIM: Option<usize> = Some(6)

§

type Smaller = Const<ella_common::::shape::{impl#60}::Smaller::{constant#0}>

§

type Larger = Dyn

source§

impl Shape for Dyn

source§

const NDIM: Option<usize> = None

§

type Smaller = Dyn

§

type Larger = Dyn