code: def gamma(
      shape, alpha, beta=None, dtype=tf.float32, seed=None, name=None
  ):
      """As `tf.random.gamma`, but handling stateful/stateless `seed`s."""
      with tf.name_scope(name or "gamma"):
          seed = sanitize_seed(seed)
          alpha = tf.convert_to_tensor(alpha, dtype=dtype)
          beta = (
              None
              if beta is None
              else tf.convert_to_tensor(beta, dtype=dtype)
          )
          params_shape = ps.shape(alpha)
          if beta is not None:
              params_shape = ps.broadcast_shape(
                  params_shape, ps.shape(beta)
              )
          shape = ps.convert_to_shape_tensor(
              shape, dtype=getattr(params_shape, "dtype", np.int32)
          )  # May be TensorShape.
          samples_shape = ps.concat([shape, params_shape], axis=0)
          return tf.random.stateless_gamma(
              shape=samples_shape,
              seed=seed,
              alpha=alpha,
              beta=beta,
              dtype=dtype,
          )
  
file_path: probability/tensorflow_probability/python/internal/samplers.py
imports: import hashlib
  import warnings
  import numpy
  import six
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import prefer_static
label_desc: Use image node_id 8 for calling a global function with example usage: gamma(shape, alpha, beta, dtype, seed, name) and returns: tf