tf.keras.backend.result_type
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.
Note: This function attempts to match the result of jnp.result_type
.
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"
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license .
Last updated 2024-06-07 UTC.
[null,null,["Last updated 2024-06-07 UTC."],[],[]]