get_uid functionkeras.backend.get_uid(prefix="")
Associates a string prefix with an integer counter.
Arguments
Returns
Unique integer ID.
Example
>>> get_uid('dense')
1
>>> get_uid('dense')
2
result_type functionkeras.backend.result_type(*dtypes)
Returns the type from applying the Keras type promotion rules.
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.
Arguments
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"
>>> z= keras.ops.ones((1,), dtype='complex64')
>>> keras.backend.result_type(z.dtype, int)
"float64"