keras/src/backend/tensorflow/random.py/gamma
def gamma(shape, alpha, dtype=None, seed=None):
    dtype = dtype or floatx()
    seed = _cast_seed(draw_seed(seed))
    # TODO: `tf.random.stateless_gamma` doesn't support bfloat16
    intemediate_dtype = dtype
    if standardize_dtype(dtype) == "bfloat16":
        intemediate_dtype = "float32"
    return tf.cast(
        tf.random.stateless_gamma(
            shape,
            alpha=alpha,
            dtype=intemediate_dtype,
            seed=seed,
        ),
        dtype,
    )