<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/backend/config.py#L44-L78) |

Set the default float dtype.

#### View aliases


**Main aliases**

[`tf.keras.config.set_floatx`](https://www.tensorflow.org/api_docs/python/tf/keras/backend/set_floatx)

<br />

    tf.keras.backend.set_floatx(
        value
    )

> [!NOTE]
> **Note:** It is not recommended to set this to `"float16"` for training, as this will likely cause numeric stability issues. Instead, mixed precision, which leverages a mix of `float16` and `float32`. It can be configured by calling `keras.mixed_precision.set_dtype_policy('mixed_float16')`.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `value` | String; `'bfloat16'`, `'float16'`, `'float32'`, or `'float64'`. |

<br />

#### Examples:

    keras.config.floatx()
    'float32'

    keras.config.set_floatx('float64')
    keras.config.floatx()
    'float64'

    # Set it back to float32
    keras.config.set_floatx('float32')

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `ValueError` | In case of invalid value. |

<br />