class_docstr: Creates a continuous Bernoulli distribution parameterized by :attr:`probs`
  or :attr:`logits` (but not both).
  
  The distribution is supported in [0, 1] and parameterized by 'probs' (in
  (0,1)) or 'logits' (real-valued). Note that, unlike the Bernoulli, 'probs'
  does not correspond to a probability and 'logits' does not correspond to
  log-odds, but the same names are used due to the similarity with the
  Bernoulli. See [1] for more details.
  
  Example::
  
      >>> # xdoctest: +IGNORE_WANT("non-deterministic")
      >>> m = ContinuousBernoulli(torch.tensor([0.3]))
      >>> m.sample()
      tensor([ 0.2538])
  
  Args:
      probs (Number, Tensor): (0,1) valued parameters
      logits (Number, Tensor): real valued parameters whose sigmoid matches 'probs'
  
  [1] The continuous Bernoulli: fixing a pervasive error in variational
  autoencoders, Loaiza-Ganem G and Cunningham JP, NeurIPS 2019.
  https://arxiv.org/abs/1907.06845
code: def __init__(
      self,
      probs=None,
      logits=None,
      lims=(0.499, 0.501),
      validate_args=None,
  ):
      if (probs is None) == (logits is None):
          raise ValueError(
              "Either `probs` or `logits` must be specified, but not both."
          )
      if probs is not None:
          is_scalar = isinstance(probs, Number)
          (self.probs,) = broadcast_all(probs)
          # validate 'probs' here if necessary as it is later clamped for numerical stability
          # close to 0 and 1, later on; otherwise the clamped 'probs' would always pass
          if validate_args is not None:
              if (
                  not self.arg_constraints["probs"]
                  .check(self.probs)
                  .all()
              ):
                  raise ValueError(
                      "The parameter probs has invalid values"
                  )
          self.probs = clamp_probs(self.probs)
      else:
          is_scalar = isinstance(logits, Number)
          (self.logits,) = broadcast_all(logits)
      self._param = self.probs if probs is not None else self.logits
      if is_scalar:
          batch_shape = torch.Size()
      else:
          batch_shape = self._param.size()
      self._lims = lims
      super().__init__(batch_shape, validate_args=validate_args)
  
imports: import math
  from numbers import Number
  import torch
  from torch.distributions import constraints
  from torch.distributions.exp_family import ExponentialFamily
  from torch.distributions.utils import broadcast_all, clamp_probs, lazy_property, logits_to_probs, probs_to_logits
  from torch.nn.functional import binary_cross_entropy_with_logits
label_desc: Use image node_id 1 to create a new ContinuousBernoulli object from inherited base classes: ExponentialFamily with example: obj = ContinuousBernoulli(probs, logits, lims, validate_args)