bartorch.conv

Contents

bartorch.conv#

bartorch.conv()#

Cyclic convolution of input with kernel along axes, of the input’s shape.

Kernel index (k - 1) // 2 sits at zero shift, so an odd kernel is centred and an even one leans to the start: out[i] = sum_j kernel[j] * input[(i - j + (k - 1) // 2) % n].

Parameters:
  • input (torch.Tensor) – Array to convolve.

  • kernel (torch.Tensor) – Aligned with input from the last axis: any size along axes, and one (shared) or the input’s size elsewhere.

  • axes (int or tuple of int) – Axes to convolve along.

Returns:

The shape of input.

Return type:

torch.Tensor