Module dfdx::shapes

source ·
Expand description

Shape related traits/structes like Shape, Dtype, Dim, Axis, and Const

Example shapes:

let _: Rank3<2, 3, 4> = Default::default();
let _: (Const<2>, Const<3>) = Default::default();
let _: (usize, Const<4>) = (3, Const);
let _ = (Const::<5>, 4, Const::<3>, 2);

Structs

  • A set of 2 axes, e.g. Axes2<0, 1>, or Axes2<1, 3>.
  • A set of 3 axes, e.g. Axes3<1, 3, 4>
  • A set of 4 axes
  • A set of 5 axes
  • A set of 6 axes
  • A singular axis, e.g. Axis<0> or Axis<1>
  • Represents a Dim with size known at compile time

Traits

  • Represents either [T; N] or Vec<T>
  • Represents a single dimension where all instances are guaranteed to be the same size at compile time.
  • Represents a Shape that has all ConstDims
  • Represents a single dimension of a multi dimensional Shape
  • Represents a data type or element of an array.
  • Represents something that has the axes Ax
  • Represents something that has a Dtype.
  • Represents something that has a Shape.
  • Represents something that has a Unit.
  • A collection of dimensions (Dim) that change how a multi-dimensional array is interacted with.
  • Represents a unit type, but no arithmetic.

Type Definitions

  • Compile time known shape with 0 dimensions
  • Compile time known shape with 1 dimensions
  • Compile time known shape with 2 dimensions
  • Compile time known shape with 3 dimensions
  • Compile time known shape with 4 dimensions
  • Compile time known shape with 5 dimensions
  • Compile time known shape with 6 dimensions