<br />

> [!NOTE]
> **Note:** This API is new and only available via `pip install tf-nightly`.

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/keras-team/keras/tree/master/keras/src/backend/config.py#L162-L203) |

Sets how Keras handles 64-bit dtypes.

```python
tf.keras.config.set_x64_mode(
    mode
)
```

64-bit dtypes are `int64`, `uint64`, `float64` and `complex128`.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `mode` | One of: <br /> - `"off"` (default on JAX, NumPy and PyTorch): the result dtype of every op is capped to 32-bit, e.g. adding two `int64` tensors gives an `int32` tensor. - `"explicit_x64"` (default and only mode on TensorFlow): a 64-bit input gives a 64-bit output. Inputs that are all 32-bit, Python scalars and default dtypes stay 32-bit (except `dtype=int`, which is `int64` on TensorFlow). This mirrors JAX's `jax_explicit_x64_dtypes="allow"`, which Keras turns on for you on the JAX backend. - `"enable_x64"`: not supported yet. |

The mode can also be set with the `KERAS_X64_MODE` environment variable
or the `"x64_mode"` field of `~/.keras/keras.json`. Set it before
creating tensors or models. Supported on the `jax`, `numpy`, `tensorflow`
and `torch` backends. On the JAX backend, Keras turns on the matching JAX
flag. If JAX's own 64-bit flags are already on and don't match `mode`,
Keras warns and keeps `mode`.

#### Example:

```python
keras.config.set_x64_mode("explicit_x64")
x = keras.ops.ones((2,), dtype="int64")
keras.ops.add(x, x).dtype
'int64'
```

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `ValueError` | If `mode` is unknown, not supported yet, or not supported on the current backend. |

<br />