This issue gathers all the information of the current APIs in NumPy, CuPy, Dask, JAX, MXNet, pytorch and tensorflow in the FFT module. The main outcome of this issue is to open the discussion of the potential APIs that are going to be included in the spec.
The current APIs involved in this issue are:
- Standard FFT: fft, ifft, fft2, ifft2, fftn, ifftn
- Real FFT: rfft, irfft, rfft2, irfft2, rfftn, irfftn
- Hermitian FFT: hfft, ihfft
- Helper Routines: fftfreq, rfftfreq, fftshift, ifftshift
Individual APIs
fft/ifft
| argument/keyword |
NumPy |
CuPy |
Dask |
JAX |
MXNet |
Pytorch |
TF |
| n |
Y |
Y |
Y |
Y |
N |
Y |
N |
| axis/dim |
Y |
Y |
Y |
Y |
N |
Y |
N |
| norm |
Y |
Y |
N |
Y |
N |
Y |
N |
| data |
N |
N |
N |
N |
Y |
N |
N |
| out |
N |
N |
N |
N |
Y |
N |
N |
| name |
N |
N |
N |
N |
Y |
N |
Y |
fft2/ifft2
| argument/keyword |
NumPy |
CuPy |
Dask |
JAX |
Pytorch |
TF |
| s |
Y |
Y |
Y |
Y |
Y |
N |
| axes/dim |
Y |
Y |
Y |
Y |
Y |
N |
| norm |
Y |
Y |
N |
Y |
Y |
N |
| name |
N |
N |
N |
N |
N |
Y |
These functions are not implemented in MXNet.
fftn/ifftn
| argument/keyword |
NumPy |
CuPy |
Dask |
JAX |
Pytorch |
| n |
Y |
Y |
N |
N |
Y |
| s |
N |
N |
Y |
Y |
N |
| axis/axes/dim |
Y |
Y |
Y |
Y |
Y |
| norm |
Y |
Y |
N |
Y |
Y |
These functions are not implemented in MXNet and TF.
rfft/irfft
| argument/keyword |
NumPy |
CuPy |
Dask |
JAX |
Pytorch |
TF |
| n |
Y |
Y |
Y |
Y |
Y |
N |
| axis/dim |
Y |
Y |
Y |
Y |
Y |
N |
| norm |
Y |
Y |
N |
Y |
Y |
N |
| fft_length |
N |
N |
N |
N |
N |
Y |
| name |
N |
N |
N |
N |
N |
Y |
These functions are not implemented in MXNet.
rfft2/irfft2
| argument/keyword |
NumPy |
CuPy |
Dask |
JAX |
Pytorch |
TF |
| s |
Y |
Y |
Y |
Y |
Y |
N |
| axes/dim |
Y |
Y |
Y |
Y |
Y |
N |
| norm |
Y |
Y |
N |
Y |
Y |
N |
| fft_length |
N |
N |
N |
N |
N |
Y |
| name |
N |
N |
N |
N |
N |
Y |
These functions are not implemented in MXNet.
rfftn/irfftn
| argument/keyword |
NumPy |
CuPy |
Dask |
JAX |
Pytorch |
| s |
Y |
Y |
Y |
Y |
Y |
| axes/dim |
Y |
Y |
Y |
Y |
Y |
| norm |
Y |
Y |
N |
Y |
Y |
These functions are not implemented in MXNet and TF.
hfft/ihfft
| argument/keyword |
NumPy |
CuPy |
Dask |
JAX |
Pytorch |
| n |
Y |
Y |
Y |
Y |
Y |
| axis/dim |
Y |
Y |
Y |
Y |
Y |
| norm |
Y |
Y |
N |
Y |
Y |
These functions are not implemented in MXNet and TF.
fftfreq/rfftfreq
| argument/keyword |
NumPy |
CuPy |
Dask |
JAX |
Pytorch |
| d |
Y |
Y |
Y |
Y |
Y |
| dtype |
N |
N |
N |
N |
Y |
| device |
N |
N |
N |
N |
Y |
| requires_grad |
N |
N |
N |
N |
Y |
| layout |
N |
N |
N |
N |
Y |
These functions are not implemented in MXNet and TF.
fftshift/ifftshift
| argument/keyword |
NumPy |
CuPy |
Dask |
JAX |
Pytorch |
| axes/dim |
Y |
Y |
Y |
Y |
Y |
These functions are not implemented in MXNet and TF.
Summary
- Most FFT APIs have the following keyword arguments:
n, axis, norm, with the exception of TF and MXNet.
- The equivalent to the
axis keyword in NumPy, CuPy, Dask and Jax is dim in Pytorch.
fft2 can have the same implementation of fftn if called with the correct arguments.
fft3D is only implemented in TF .
- The output for the inverse functions return a complex array in NumPy.
- The arguments of the functions are the same for calculating the FFT and its inverse.
- There's a mix between the use of
axis, axes even among functions in the same library.
This issue gathers all the information of the current APIs in NumPy, CuPy, Dask, JAX, MXNet, pytorch and tensorflow in the FFT module. The main outcome of this issue is to open the discussion of the potential APIs that are going to be included in the spec.
The current APIs involved in this issue are:
Individual APIs
fft/ifft
fft2/ifft2
These functions are not implemented in MXNet.
fftn/ifftn
These functions are not implemented in MXNet and TF.
rfft/irfft
These functions are not implemented in MXNet.
rfft2/irfft2
These functions are not implemented in MXNet.
rfftn/irfftn
These functions are not implemented in MXNet and TF.
hfft/ihfft
These functions are not implemented in MXNet and TF.
fftfreq/rfftfreq
These functions are not implemented in MXNet and TF.
fftshift/ifftshift
These functions are not implemented in MXNet and TF.
Summary
n,axis,norm, with the exception of TF and MXNet.axiskeyword in NumPy, CuPy, Dask and Jax isdimin Pytorch.fft2can have the same implementation offftnif called with the correct arguments.fft3Dis only implemented in TF .axis,axeseven among functions in the same library.