bartorch.conv#
- bartorch.conv(input, kernel, axes)#
Cyclic convolution of
inputwithkernelalongaxes, of the input’s shape.Kernel index
(k - 1) // 2sits 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
inputfrom the last axis. Alongaxesany size; along the other axes one (shared) or the input’s size (per slice).