ella_tensor

Trait Shape

Source
pub trait Shape:
    Debug
    + Send
    + Sync
    + Clone
    + Eq
    + PartialEq
    + 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 Constants§

Required Associated Types§

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

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 Shape for Const<0>

Source§

const NDIM: Option<usize>

Source§

type Smaller = Const<0>

Source§

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

Source§

impl Shape for Const<1>

Source§

const NDIM: Option<usize>

Source§

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

Source§

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

Source§

impl Shape for Const<2>

Source§

const NDIM: Option<usize>

Source§

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

Source§

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

Source§

impl Shape for Const<3>

Source§

const NDIM: Option<usize>

Source§

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

Source§

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

Source§

impl Shape for Const<4>

Source§

const NDIM: Option<usize>

Source§

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

Source§

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

Source§

impl Shape for Const<5>

Source§

const NDIM: Option<usize>

Source§

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

Source§

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

Source§

impl Shape for Const<6>

Source§

const NDIM: Option<usize>

Source§

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

Source§

type Larger = Dyn

Source§

impl Shape for Dyn