{"id":26989,"library":"fft-conv-pytorch","title":"FFT Conv PyTorch","description":"Implementation of 1D, 2D, and 3D FFT convolutions in PyTorch. Current version 1.2.0, supports padding='same' and half-precision input. Release cadence is irregular; latest updates in 2023.","status":"active","version":"1.2.0","language":"python","source_language":"en","source_url":"https://github.com/fkodom/fft-conv-pytorch","tags":["fft","convolution","pytorch","deep-learning","1d","2d","3d"],"install":[{"cmd":"pip install fft-conv-pytorch","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Core dependency; the library uses PyTorch tensors and FFT operations.","package":"torch","optional":false}],"imports":[{"note":"Correct import path.","symbol":"FFTConv1d","correct":"from fft_conv_pytorch import FFTConv1d"},{"note":"Correct import path.","symbol":"FFTConv2d","correct":"from fft_conv_pytorch import FFTConv2d"},{"note":"Correct import path.","symbol":"FFTConv3d","correct":"from fft_conv_pytorch import FFTConv3d"}],"quickstart":{"code":"import torch\nfrom fft_conv_pytorch import FFTConv2d\n\nconv = FFTConv2d(in_channels=3, out_channels=16, kernel_size=3, padding='same')\nx = torch.randn(1, 3, 32, 32)\ny = conv(x)\nprint(y.shape)  # torch.Size([1, 16, 32, 32])","lang":"python","description":"Create a 2D FFT convolutional layer with 'same' padding and run a forward pass."},"warnings":[{"fix":"Upgrade PyTorch to >= 1.8.","message":"Requires PyTorch >= 1.8 for gradient support on dilated convolutions; earlier versions may break gradient computation.","severity":"breaking","affected_versions":"1.1.2+"},{"fix":"Ensure your code does not rely on gradient computation via einsum; re-implement custom operations if needed.","message":"In version 1.0.1, einsum usage was removed for efficiency; custom gradients from previous versions may not work.","severity":"breaking","affected_versions":">=1.0.1"},{"fix":"Upgrade to 1.2.0 or use padding='valid' and full-precision tensors.","message":"Padding='same' and half-precision support added in 1.2.0; using these with older versions will raise an error.","severity":"breaking","affected_versions":"<1.2.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Ensure you have installed fft-conv-pytorch and use: from fft_conv_pytorch import FFTConv2d","cause":"Incorrect import path or library not installed.","error":"ImportError: cannot import name 'FFTConv2d' from 'fft_conv_pytorch'"},{"fix":"Move both input and model to the same device, e.g., conv.to(device) and x = x.to(device).","cause":"Input tensor and kernel not on the same device (CPU/GPU).","error":"RuntimeError: Expected all tensors to be on the same device, but found at least two devices"},{"fix":"Set padding='valid' or padding='same' (supported from v1.2.0+).","cause":"Padding argument is not one of the allowed values.","error":"ValueError: padding must be 'valid' or 'same'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}