<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/keras-team/keras/tree/v3.15.1/keras/src/ops/math.py#L602-L627) |

Computes the 2D Fast Fourier Transform along the last two axes of input.

    tf.keras.ops.fft2(
        x
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `x` | Tuple of the real and imaginary parts of the input tensor. Both tensors in the tuple should be of floating type. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A tuple containing two tensors - the real and imaginary parts of the output. ||

<br />

#### Example:

    x = (
        keras.ops.convert_to_tensor([[1., 2.], [2., 1.]]),
        keras.ops.convert_to_tensor([[0., 1.], [1., 0.]]),
    )
    fft2(x)
    (array([[ 6.,  0.],
        [ 0., -2.]], dtype=float32), array([[ 2.,  0.],
        [ 0., -2.]], dtype=float32))