Returns the type from applying the Keras type promotion rules.
tf.keras.backend.result_type(
*dtypes
)
In general, each argument is first parsed by backend.standardize_dtype,
and the resulting dtype is determined by the least upper bound of the type
promotion lattice.
Args
dtypes
Input dtypes.
Returns
The result dtype.
Examples:
x = keras.ops.ones((1,), dtype="bfloat16")keras.backend.result_type(x.dtype, int)"bfloat16"
x = keras.ops.ones((1,), dtype="int32")y = keras.ops.ones((1,), dtype="float32")keras.backend.result_type(x.dtype, y.dtype)"float32"