code: def bernoulli(x: TensorType, p: TensorType) -> tf.Tensor:
      return tf.math.log(tf.where(tf.equal(x, 1), p, 1 - p))
  
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 3 for calling a global function with example usage: bernoulli(x, p) and returns: tf