Trait ConvExt

Source
pub trait ConvExt<'a, T, S, SK, const N: usize>
where T: NumAssign + Copy, S: RawData, SK: RawData,
{ // Required method fn conv( &self, kernel: impl IntoKernelWithDilation<'a, SK, N>, conv_mode: ConvMode<N>, padding_mode: PaddingMode<N, T>, ) -> Result<Array<T, Dim<[Ix; N]>>, Error<N>>; }
Expand description

Extends ndarray’s ArrayBase with convolution operations.

This trait adds the conv method to ArrayBase, enabling standard convolution operations on N-dimensional arrays.

§Type Parameters

  • T: The numeric type of the array elements.
  • S: The data storage type of the input array.
  • SK: The data storage type of the kernel array.

Required Methods§

Source

fn conv( &self, kernel: impl IntoKernelWithDilation<'a, SK, N>, conv_mode: ConvMode<N>, padding_mode: PaddingMode<N, T>, ) -> Result<Array<T, Dim<[Ix; N]>>, Error<N>>

Performs a standard convolution operation.

This method convolves the input array with a given kernel, using the specified convolution mode and padding.

§Arguments
  • kernel: The convolution kernel.
  • conv_mode: The convolution mode (Full, Same, Valid, Custom, Explicit).
  • padding_mode: The padding mode (Zeros, Const, Reflect, Replicate, Circular, Custom, Explicit).
§Returns

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.

Implementations on Foreign Types§

Source§

impl<'a, T, S, SK, const N: usize> ConvExt<'a, T, S, SK, N> for ArrayBase<S, Dim<[Ix; N]>>
where T: NumAssign + Copy, S: Data<Elem = T> + 'a, SK: Data<Elem = T> + 'a, Dim<[Ix; N]>: RemoveAxis, [Ix; N]: IntoDimension<Dim = Dim<[Ix; N]>>, SliceInfo<[SliceInfoElem; N], Dim<[Ix; N]>, Dim<[Ix; N]>>: SliceArg<Dim<[Ix; N]>, OutDim = Dim<[Ix; N]>>,

Source§

fn conv( &self, kernel: impl IntoKernelWithDilation<'a, SK, N>, conv_mode: ConvMode<N>, padding_mode: PaddingMode<N, T>, ) -> Result<Array<T, Dim<[Ix; N]>>, Error<N>>

Implementors§