bartorch.conv

Contents

bartorch.conv#

bartorch.conv(input, kernel, axes)#

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:

kernel (torch.Tensor) – Aligned with input from the last axis. Along axes any size; along the other axes one (shared) or the input’s size (per slice).