code: def bernoulli(
      probs: Union[float, paddle.Tensor],
      *,
      logits: Union[float, paddle.Tensor] = None,
      shape: Optional[Union[ivy.NativeArray, Sequence[int]]] = None,
      device: core.Place = None,
      dtype: paddle.dtype,
      seed: Optional[int] = None,
      out: Optional[paddle.Tensor] = None,
  ) -> paddle.Tensor:
      if seed is not None:
          paddle.seed(seed)
      if probs is not None:
          probs = probs
      elif logits is not None:
          probs = ivy.softmax(logits)
      probs = paddle.cast(probs, dtype)
      probs = (
          paddle.unsqueeze(probs, 0) if len(probs.shape) == 0 else probs
      )
      probs = paddle.maximum(probs, paddle.full_like(probs, 1e-6))
      sample = paddle.bernoulli(probs)
      return sample
  
file_path: ivy/ivy/functional/backends/paddle/experimental/random.py
imports: from typing import Optional, Union, Sequence
  import paddle
  from ivy import with_unsupported_device_and_dtypes
  from ivy.functional.backends.paddle import backend_version
  from ivy.utils.exceptions import IvyNotImplementedException
  from ivy.functional.ivy.random import _check_bounds_and_get_shape
  import ivy
  from paddle.device import core
  from ivy import with_supported_device_and_dtypes
label_desc: Use image node_id 5 for calling a global function with example usage: bernoulli(probs) and returns: sample