tidy3d.plugins.autograd.functions.convolve

Contents

tidy3d.plugins.autograd.functions.convolve#

class convolve[source]#

Bases:

Convolve an array with a given kernel.

Parameters:
  • array (NDArray) – The input array to be convolved.

  • kernel (NDArray) – The kernel to convolve with the input array. All dimensions of the kernel must be odd.

  • padding (_pad_modes, optional) – The padding mode to use. Default is “constant”.

  • axes (Union[Tuple[List[int], List[int]], None], optional) – The axes along which to perform the convolution. Default is None (all axes).

  • mode (Literal["full", "valid", "same"], optional) – The convolution mode. Default is “same”.

Returns:

The result of the convolution.

Return type:

NDArray

Raises:

ValueError – If any dimension of the kernel is even. If the dimensions of the kernel do not match the dimensions of the array.

Inherited Common Usage