tidy3d.plugins.autograd.functions.convolve

Contents

tidy3d.plugins.autograd.functions.convolve#

class convolve[source]#

Bases:

Convolve an array with a given kernel.

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

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

  • padding (PaddingType = "constant") – The padding mode to use.

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

  • mode (Literal["full", "valid", "same"] = "same") – The convolution mode.

Returns:

The result of the convolution.

Return type:

np.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