Skip to content

Summary of FFT APIs #159

Description

@steff456

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/keywordNumPyCuPyDaskJAXMXNetPytorchTF
nYYYYNYN
axis/dimYYYYNYN
normYYNYNYN
dataNNNNYNN
outNNNNYNN
nameNNNNYNY

fft2/ifft2

argument/keywordNumPyCuPyDaskJAXPytorchTF
sYYYYYN
axes/dimYYYYYN
normYYNYYN
nameNNNNNY

These functions are not implemented in MXNet.

fftn/ifftn

argument/keywordNumPyCuPyDaskJAXPytorch
nYYNNY
sNNYYN
axis/axes/dimYYYYY
normYYNYY

These functions are not implemented in MXNet and TF.

rfft/irfft

argument/keywordNumPyCuPyDaskJAXPytorchTF
nYYYYYN
axis/dimYYYYYN
normYYNYYN
fft_lengthNNNNNY
nameNNNNNY

These functions are not implemented in MXNet.

rfft2/irfft2

argument/keywordNumPyCuPyDaskJAXPytorchTF
sYYYYYN
axes/dimYYYYYN
normYYNYYN
fft_lengthNNNNNY
nameNNNNNY

These functions are not implemented in MXNet.

rfftn/irfftn

argument/keywordNumPyCuPyDaskJAXPytorch
sYYYYY
axes/dimYYYYY
normYYNYY

These functions are not implemented in MXNet and TF.

hfft/ihfft

argument/keywordNumPyCuPyDaskJAXPytorch
nYYYYY
axis/dimYYYYY
normYYNYY

These functions are not implemented in MXNet and TF.

fftfreq/rfftfreq

argument/keywordNumPyCuPyDaskJAXPytorch
dYYYYY
dtypeNNNNY
deviceNNNNY
requires_gradNNNNY
layoutNNNNY

These functions are not implemented in MXNet and TF.

fftshift/ifftshift

argument/keywordNumPyCuPyDaskJAXPytorch
axes/dimYYYYY

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    API extensionAdds new functions or objects to the API.topic: FFTFast Fourier transforms.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions