View source on GitHub
|
Sets how Keras handles 64-bit dtypes.
tf.keras.config.set_x64_mode(
mode
)
64-bit dtypes are int64, uint64, float64 and complex128.
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:
keras.config.set_x64_mode("explicit_x64")x = keras.ops.ones((2,), dtype="int64")keras.ops.add(x, x).dtype'int64'
Raises | |
|---|---|
ValueError
|
If mode is unknown, not supported yet, or not supported
on the current backend.
|
View source on GitHub