Trait ha_ndarray::NDArrayTransform
source · 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§
sourcetype Broadcast: NDArray<DType = Self::DType> + NDArrayRead + NDArrayTransform
type Broadcast: NDArray<DType = Self::DType> + NDArrayRead + NDArrayTransform
The type returned by broadcast
sourcetype Expand: NDArray<DType = Self::DType> + NDArrayRead + NDArrayTransform
type Expand: NDArray<DType = Self::DType> + NDArrayRead + NDArrayTransform
The type returned by expand_dims
sourcetype Reshape: NDArray<DType = Self::DType> + NDArrayRead + NDArrayTransform
type Reshape: NDArray<DType = Self::DType> + NDArrayRead + NDArrayTransform
The type returned by reshape
sourcetype Slice: NDArray<DType = Self::DType> + NDArrayRead + NDArrayTransform
type Slice: NDArray<DType = Self::DType> + NDArrayRead + NDArrayTransform
The type returned by slice
sourcetype Transpose: NDArray<DType = Self::DType> + NDArrayRead + NDArrayTransform
type Transpose: NDArray<DType = Self::DType> + NDArrayRead + NDArrayTransform
The type returned by transpose
Required Methods§
sourcefn broadcast(self, shape: Shape) -> Result<Self::Broadcast, Error>
fn broadcast(self, shape: Shape) -> Result<Self::Broadcast, Error>
Broadcast this array into the given shape
.
sourcefn expand_dims(self, axes: Vec<usize>) -> Result<Self::Expand, Error>
fn expand_dims(self, axes: Vec<usize>) -> Result<Self::Expand, Error>
Expand the given axes
of this array.
sourcefn reshape(self, shape: Shape) -> Result<Self::Reshape, Error>
fn reshape(self, shape: Shape) -> Result<Self::Reshape, Error>
Reshape this array into the given shape
.