code: def bernoulli(
      probs: Union[float, tf.Tensor, tf.Variable],
      *,
      logits: Union[float, tf.Tensor, tf.Variable] = None,
      shape: Optional[Union[ivy.NativeShape, Sequence[int]]] = None,
      device: Optional[str] = None,
      dtype: DType,
      seed: Optional[int] = None,
      out: Optional[Union[tf.Tensor, tf.Variable]] = None,
  ) -> Union[tf.Tensor, tf.Variable]:
      if seed is not None:
          tf.random.set_seed(seed)
      if logits is not None:
          logits = tf.cast(logits, dtype)
          if not _check_shapes_broadcastable(shape, logits.shape):
              shape = logits.shape
      elif probs is not None:
          probs = tf.cast(probs, dtype)
          if not _check_shapes_broadcastable(shape, probs.shape):
              shape = probs.shape
      return tfp.distributions.Bernoulli(
          logits=logits, probs=probs, dtype=dtype, allow_nan_stats=True
      ).sample(shape, seed)
  
file_path: ivy/ivy/functional/backends/tensorflow/sub_backends/tf_probability/experimental/random.py
imports: from ivy.func_wrapper import with_unsupported_dtypes
  from ivy.functional.ivy.random import _check_bounds_and_get_shape, _check_shapes_broadcastable
  import tensorflow_probability
  from tensorflow_probability import distributions
  import tensorflow
  from tensorflow.python.framework.dtypes import DType
  from typing import Optional, Sequence, Union
  from ....None import backend_version
  import ivy
label_desc: Use image node_id 3 for calling a global function with example usage: bernoulli(probs) and returns: tfp