pub trait NDArrayTransform: NDArray + Debug {
    type Broadcast: NDArray<DType = Self::DType> + NDArrayRead + NDArrayTransform;
    type Expand: NDArray<DType = Self::DType> + NDArrayRead + NDArrayTransform;
    type Reshape: NDArray<DType = Self::DType> + NDArrayRead + NDArrayTransform;
    type Slice: NDArray<DType = Self::DType> + NDArrayRead + NDArrayTransform;
    type Transpose: NDArray<DType = Self::DType> + NDArrayRead + NDArrayTransform;

    // Required methods
    fn broadcast(self, shape: Shape) -> Result<Self::Broadcast, Error>;
    fn expand_dims(self, axes: Vec<usize>) -> Result<Self::Expand, Error>;
    fn reshape(self, shape: Shape) -> Result<Self::Reshape, Error>;
    fn slice(self, bounds: Vec<AxisBound>) -> Result<Self::Slice, Error>;
    fn transpose(
        self,
        permutatin: Option<Vec<usize>>
    ) -> Result<Self::Transpose, Error>;
}
Expand description

Array transform operations

Required Associated Types§

source

type Broadcast: NDArray<DType = Self::DType> + NDArrayRead + NDArrayTransform

The type returned by broadcast

source

type Expand: NDArray<DType = Self::DType> + NDArrayRead + NDArrayTransform

The type returned by expand_dims

source

type Reshape: NDArray<DType = Self::DType> + NDArrayRead + NDArrayTransform

The type returned by reshape

source

type Slice: NDArray<DType = Self::DType> + NDArrayRead + NDArrayTransform

The type returned by slice

source

type Transpose: NDArray<DType = Self::DType> + NDArrayRead + NDArrayTransform

The type returned by transpose

Required Methods§

source

fn broadcast(self, shape: Shape) -> Result<Self::Broadcast, Error>

Broadcast this array into the given shape.

source

fn expand_dims(self, axes: Vec<usize>) -> Result<Self::Expand, Error>

Expand the given axes of this array.

source

fn reshape(self, shape: Shape) -> Result<Self::Reshape, Error>

Reshape this array into the given shape.

source

fn slice(self, bounds: Vec<AxisBound>) -> Result<Self::Slice, Error>

Construct a slice of this array.

source

fn transpose( self, permutatin: Option<Vec<usize>> ) -> Result<Self::Transpose, Error>

Transpose this array according to the given permutation. If no permutation is given, the array axes will be reversed.

Implementors§