code: def beta(
      x: TensorType, alpha: TensorType, beta: TensorType
  ) -> tf.Tensor:
      # need to clip x, since log of 0 is nan...
      x = tf.clip_by_value(x, 1e-6, 1 - 1e-6)
      return (
          (alpha - 1.0) * tf.math.log(x)
          + (beta - 1.0) * tf.math.log(1.0 - x)
          + tf.math.lgamma(alpha + beta)
          - tf.math.lgamma(alpha)
          - tf.math.lgamma(beta)
      )
  
file_path: GPflow/gpflow/logdensities.py
imports: import numpy
  import tensorflow
  from check_shapes import check_shapes
  from .base import TensorType
  from .utilities import to_default_float
label_desc: Use image node_id 8 for calling a global function with example usage: beta(x, alpha, beta) and returns: unknown